import { Button } from "../components/Button"; import { Toaster, useToast } from "../components/Toast"; export default { title: "React/Toast", tags: ["!autodocs"], decorators: [ (Story: any) => ( <> {Story()} ), ], }; export const Default = () => { const { toast } = useToast(); return ( <> ); }; const fetchAndWaitForSuccess = (): Promise => { return new Promise((resolve) => setTimeout(() => resolve("LoremSuccess"), 3000) ); }; const fetchAndWaitForError = (): Promise => { return new Promise((_, reject) => setTimeout(() => reject("LoremError"), 3000) ); }; export const PromiseWaitSuccess = () => { const { toast } = useToast(); return ( <> ); }; export const PromiseWaitError = () => { const { toast } = useToast(); return ( <> ); };