import React from 'react'
import { Story, Meta } from '@storybook/react'
import { Toast, ToastProps } from './Toast'

export default {
  title: 'Feedback indicators/Toast',
  component: Toast,
  argTypes: {
    content: {
      name: 'content',
      description: 'The content that should appear in the toast message',
      type: { name: 'string', required: true }
    },
    duration: {
      name: 'duration',
      description:
        'The length of time in milliseconds the toast message should persist',
      type: { name: 'number', required: false }
    }
  }
} as Meta

const Template: Story<ToastProps> = (args: any) => {
  return <Toast {...args}></Toast>
}

export const Default = Template.bind({})
Default.args = {
  content: 'Image uploaded',
  onDismiss: () => alert('onDismiss')
}
