import React, { useState } from 'react'; import { ComponentStory } from '@storybook/react'; import { Button } from '../Button'; import { Flex } from '../Layout'; import { Text } from '../Text'; import { Toast } from './Toast'; import ToastDocs from './Toast.mdx'; const ToastStory = ({ ...props }) => { return ( ); }; const ToastMeta = { title: 'UI Components/Toast', component: ToastStory, argTypes: { onClick: { action: 'clicked' }, icon: { control: 'boolean' }, }, parameters: { docs: { page: ToastDocs, }, }, }; const ToastComponent = ({ ...props }) => { const [isOpen, setIsOpen] = useState(false); return ( <> setIsOpen(o)} {...props}> Hello from toast. This is a custom toast component using primitives with controlled open and close state using React state. ); }; export const Example: ComponentStory = ToastStory.bind({}); Example.storyName = 'Toast'; export default ToastMeta;