"use client"; import { useEffect, useState } from "react"; import type { Notification } from "../../hooks/useClients"; interface ToastProps { notification: Notification | null; } export function Toast({ notification }: ToastProps) { const [visible, setVisible] = useState(false); useEffect(() => { if (notification) { setVisible(true); } else { const t = setTimeout(() => setVisible(false), 300); return () => clearTimeout(t); } }, [notification]); if (!visible && !notification) return null; const isSuccess = notification?.type === "success"; return (