import React, { useState } from 'react'

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

import { Textarea } from '../components'

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

const Template: ComponentStory<typeof Textarea> = (args) => {
  const [value, setValue] = useState('')

  return (
    <>
      <Textarea
        {...args}
        label='Textarea'
        value={value}
        onChange={(e) => setValue(e)}
      />
    </>
  )
}

export const Element = Template.bind({})
