import type { Story, ComponentMeta } from '@storybook/react'; import type { SwitchProps } from './switch'; import { Switch } from './switch'; import { useState } from 'react'; export default { component: Switch, title: 'Switch', } as ComponentMeta; const Template: Story = (args) => { const [checked, setChecked] = useState(args.checked || false); return ( setChecked(checked)} /> ); }; export const Default = Template.bind({}); Default.args = { name: 'switch', }; export const WithTextLabel = Template.bind({}); WithTextLabel.args = { name: 'switch', labelText: 'Light mode', };