import { StoryObj, Meta } from '@storybook/react'; import { Toaster, useToast } from 'components/shared/Toast'; import { Button } from 'components/shared/Button'; const meta: Meta = { title: 'Components/Toaster', component: Toaster, tags: ['autodocs'], parameters: { layout: 'centered', }, argTypes: {}, }; export default meta; type Story = StoryObj; // trigger the toast const Toast = () => { const { toast, dismiss } = useToast(); return (
{(['success', 'error', 'warning', 'info', 'loading'] as const).map( (variant, index) => ( ), )}
); }; // trigger the toast with cta const ToastWithCta = () => { const { toast, dismiss } = useToast(); return (
{(['success', 'error', 'warning', 'info', 'loading'] as const).map( (variant, index) => ( ), )}
); }; export const Default: Story = { render: ({}) => (
), }; export const WithCta: Story = { render: ({}) => ( <> ), };