"use client"; import { AlertTriangle, CheckCircle2, Info, X, XCircle } from "lucide-react"; import clsx from "clsx"; import { useToast, type ToastKind } from "@/lib/toast"; const ICON: Record = { info: Info, success: CheckCircle2, warning: AlertTriangle, error: XCircle }; const STYLE: Record = { info: "border-accent/40 bg-surface-1", success: "border-ok/50 bg-surface-1", warning: "border-warn/60 bg-surface-1", error: "border-crit/60 bg-surface-1", }; const ICON_STYLE: Record = { info: "text-accent", success: "text-ok", warning: "text-warn-ink", error: "text-crit" }; export function Toaster() { const { toasts, dismiss } = useToast(); if (!toasts.length) return null; return (
{toasts.map((t) => { const Icon = ICON[t.kind]; return (
{t.title}
{t.detail &&
{t.detail}
} {t.requestId && (
request_id {t.requestId}
)}
); })}
); }