"use client"; import type { ReactNode } from "react"; export type NotificationTone = "info" | "success" | "danger"; export type NotificationItem = { id: string; title: string; message?: string; tone: NotificationTone; closing: boolean; }; type NotificationsToasterProps = { items: NotificationItem[]; onDismiss: (id: string) => void; }; function toneClasses(tone: NotificationTone) { if (tone === "success") return "border-emerald-400/40 text-emerald-200"; if (tone === "danger") return "border-red-400/50 text-red-200"; return "border-accent-weak text-[color:var(--color-text)]"; } export default function NotificationsToaster({ items, onDismiss }: NotificationsToasterProps) { if (!items.length) return null; return (
{items.map(item => (
{item.title}
{item.message ?
{item.message}
: null}
))}
); }