import React, { useState } from 'react'

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

import { Select } from '../components'

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

const Template: ComponentStory<typeof Select> = (args) => {
  const [value, set] = useState<string>('')

  return (
    <>
      <Select {...args} value={value} onChange={(e) => set(e)} />
    </>
  )
}

export const Element = Template.bind({})

Element.args = {
  label: 'Select an Option',
  options: [{ name: 'Test Select', value: 'test' }],
}
