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

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

export const Default: Story = {
  render: () => { const [v, setV] = useState(false); return <Switch checked={v} onChange={setV} label="Enable notifications" />; },
};
export const On: Story = {
  render: () => { const [v, setV] = useState(true); return <Switch checked={v} onChange={setV} label="Dark mode" />; },
};
