import { useState, ComponentProps } from "react"; import { Meta, StoryObj } from "@storybook/react"; import { InputDateRange } from "."; type Props = ComponentProps; export default { component: InputDateRange, decorators: [ (Story, context) => { const [value, setValue] = useState(context.args.value || [null, null]); return ; } ] } as Meta; export const StartDateOnly: StoryObj = { args: { value: [new Date(2022, 0, 1), null] } }; export const EndDateOnly: StoryObj = { args: { value: [null, new Date(2022, 3, 1)] } }; export const StartAndEndDates: StoryObj = { args: { value: [new Date(2022, 0, 1), new Date(2022, 3, 1)] } }; export const Empty: StoryObj = {};