import { useSyncExternalStore } from "react"; import { AlertCircle, AlertTriangle, CheckCircle2, Info, X, XCircle, } from "lucide-react"; import { dismiss, getActiveToasts, subscribe, type NotifLevel, } from "../lib/notifications"; export const LEVEL_STYLE: Record< NotifLevel, { icon: typeof Info; color: string; bar: string } > = { info: { icon: Info, color: "text-accent", bar: "bg-accent" }, success: { icon: CheckCircle2, color: "text-emerald-400", bar: "bg-emerald-400" }, warning: { icon: AlertTriangle, color: "text-amber-400", bar: "bg-amber-400" }, error: { icon: AlertCircle, color: "text-red-400", bar: "bg-red-400" }, fatal: { icon: XCircle, color: "text-red-500", bar: "bg-red-500" }, }; export default function Toaster() { const toasts = useSyncExternalStore(subscribe, getActiveToasts, getActiveToasts); return (