import { useState } from "react"; import { Meta, StoryFn } from "@storybook/react"; import SelectDate, { PickDate } from "./SelectDate"; /** * Select a date */ export default { title: "Components/SelectDate", component: SelectDate, tags: ["autodocs"], parameters: { layout: "centered", }, } as Meta; const Template: StoryFn = (args, context) => { const [date, setDate] = useState(); return context.name === "Picker" ? ( ) : ( ); }; const now = new Date().valueOf(); export const Basic = Template.bind({}); export const QuickOptions = Template.bind({}); export const WithInput = Template.bind({}); export const Picker = Template.bind({}); Basic.args = { align: "start", quickOptions: [], }; QuickOptions.args = { align: "start", quickOptions: [ { label: "7 Days Ago", date: new Date(now - 86400000 * 7), }, { label: "30 Days Ago", date: new Date(now - 86400000 * 30), }, ], }; WithInput.args = { showInput: true, };