import React, { useState } from 'react'

import { ComponentStory, ComponentMeta } from '@storybook/react'

import { Date } from '../components'

export default {
  title: 'Form/Date',
  component: Date
} as ComponentMeta<typeof Date>

const Template: ComponentStory<typeof Date> = args => {
  const [date, set] = useState('')

  return (
    <Date {...args} value={date} onChange={(event: string) => set(event)} />
  )
}

export const Element = Template.bind({})

Element.args = {
  label: 'Date'
}
