import React from 'react'; import { Meta, Story } from '@storybook/react'; import { Alert, AlertBaseProps } from './Alert'; export default { title: 'Components/Alert', component: Alert, argTypes: {}, parameters: { controls: { expanded: true }, }, } as Meta; interface AlertStoryProps { title: string; content: string; } const AlertStory = [ { type: 'success', title: 'Success!', content: 'Records have been updated.', }, { type: 'error', title: 'Error!', content: 'Unable to save record.', }, { type: 'warning', title: 'Warning', content: 'You have lost internet connectivity', }, { type: 'info', title: 'Information', content: 'You look like you need some coffee.', }, ]; const DefaultTemplate: Story = args => ( {args.title} ); export const Default = DefaultTemplate.bind({}); Default.args = { title: 'Success', type: 'success', }; const MultilineTemplate: Story = args => ( {args.title} {args.content} ); export const Multiline = MultilineTemplate.bind({}); Multiline.args = { title: 'Success', content: 'Successfully created', type: 'success', }; const StackedTemplate: Story = () => ( {AlertStory.map((alert: any, index: number) => { return ( {alert.title} {alert.content} ); })} ); export const Stacked = StackedTemplate.bind({}); Stacked.args = {};