import type { Meta, StoryObj } from '@storybook/react'; import { action } from 'storybook/actions'; import React, { useState } from 'react'; import { SwitchInput } from '../SwitchInput'; const meta: Meta = { title: 'Form/SwitchInput', component: SwitchInput, }; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => { const [isChecked, setChecked] = useState(false); return ( { action('onChange')(e); setChecked(e.target.checked); }} /> ); }, }; export const Checked: Story = { render: (args) => { const [isChecked, setChecked] = useState(true); return ( { action('onChange')(e); setChecked(e.target.checked); }} /> ); }, }; export const Disabled: Story = { args: { isDisabled: true, }, }; export const DisabledAndChecked: Story = { args: { isDisabled: true, isChecked: true, }, }; export const InADisabledFieldset: Story = { render: (args) => (
), };