import { useState, ComponentProps } from "react"; import { Meta, StoryObj } from "@storybook/react"; import { InputDateSingle } from "."; type Props = ComponentProps; export default { component: InputDateSingle, decorators: [ (Story, context) => { const [value, setValue] = useState(context.args.value || undefined); return ; } ] } as Meta; export const WithDate: StoryObj = { args: { value: new Date(2022, 0, 1) } }; export const WithError: StoryObj = { args: { // @ts-expect-error "Story expects bad input" value: new Date(undefined) } }; export const Empty: StoryObj = {};