import type { Meta, StoryObj } from "@storybook/preact";
import { Slider } from "./Slider";
import { useState } from "preact/hooks";

const meta: Meta<typeof Slider> = { title: "Primitives/Slider", component: Slider };
export default meta;
type Story = StoryObj<typeof Slider>;

export const Default: Story = {
  render: () => { const [v, setV] = useState(50); return <div class="w-64"><Slider value={v} onChange={setV} label="Budget" /></div>; },
};
export const Rating: Story = {
  render: () => { const [v, setV] = useState(3); return <div class="w-64"><Slider value={v} onChange={setV} min={1} max={5} step={1} label="Rating" /></div>; },
};
