diff --git a/client/src/components/ui/toaster.tsx b/client/src/components/ui/toaster.tsx new file mode 100644 index 0000000..7f0c5eb --- /dev/null +++ b/client/src/components/ui/toaster.tsx @@ -0,0 +1,29 @@ +import { useEffect, useState } from "react"; +import { useToast } from "../../hooks/use-toast"; +import { X } from "lucide-react"; + +export function Toaster() { + const { toasts, subscribe } = useToast(); + + useEffect(() => { + const unsub = subscribe(); + return unsub; + }, [subscribe]); + + return ( +
+ {toasts.map((t) => ( +
+
+ {t.title &&

{t.title}

} + {t.description &&

{t.description}

} +
+
+ ))} +
+ ); +}