import type { Story, Meta } from '@storybook/react';

import { Button } from '../../button';

import { SnackbarAlert } from './snackbar-alert';
import { SnackbarAlertProps } from './snackbar-alert';

export default {
  component: SnackbarAlert,
  title: 'Pop Overs/Batch Action/SnackbarAlert',
  argTypes: {
    children: {
      description: 'The content of the snackbar.'
    },
    alertProps: {
      description:
        'Props which will be forwarded into the Alert component. More info at https://mui.com/api/alert/'
    }
  }
} as Meta;

const Template: Story<SnackbarAlertProps> = args => <SnackbarAlert {...args} />;

export const Primary = Template.bind({});
Primary.args = {
  children: 'Content',
  open: true,
  alertProps: {
    variant: 'outlined',
    severity: 'info',
    action: (
      <Button color="secondary" size="small">
        I am a button
      </Button>
    ),
    onClose: () => alert('Will close snackbar')
  }
};
