import { useEffect, useState } from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { Switch as Control, type SwitchProps } from "."; import { excludeControls } from "../../utils"; type StoryType = StoryObj; const meta: Meta = { title: "Components/Switch", component: Control, argTypes: excludeControls("className"), }; const Switch = (args: SwitchProps) => { const [checked, setChecked] = useState(args.checked); useEffect(() => { setChecked(args.checked); }, [args.checked]); return ; }; export const Default: StoryType = { render: (args: SwitchProps) => , args: { checked: false, }, }; export default meta;