"use client"; import { X, CheckCircle, AlertCircle, Info, AlertTriangle } from "lucide-react"; import { cn } from "@/lib/utils"; import { useNotificationStore } from "@/store/notifications"; const typeConfig = { success: { icon: CheckCircle, className: "border-green-500 bg-green-50 dark:bg-green-950/20", iconColor: "text-green-600 dark:text-green-400", }, error: { icon: AlertCircle, className: "border-red-500 bg-red-50 dark:bg-red-950/20", iconColor: "text-red-600 dark:text-red-400", }, warning: { icon: AlertTriangle, className: "border-yellow-500 bg-yellow-50 dark:bg-yellow-950/20", iconColor: "text-yellow-600 dark:text-yellow-400", }, info: { icon: Info, className: "border-blue-500 bg-blue-50 dark:bg-blue-950/20", iconColor: "text-blue-600 dark:text-blue-400", }, }; export function NotificationToast() { const { notifications, removeNotification } = useNotificationStore(); // Only show toasts that should auto-close const visibleToasts = notifications .filter((n) => n.autoClose) .slice(0, 3); // Limit to 3 visible toasts return (
{visibleToasts.map((notification) => { const config = typeConfig[notification.type]; const Icon = config.icon; return (

{notification.title}

{notification.message && (

{notification.message}

)}
); })}
); }