"use client"; import { useEffect } from 'react'; interface ToastProps { message: string; type: 'success' | 'error' | 'warning' | 'info'; onClose: () => void; duration?: number; } export default function Toast({ message, type, onClose, duration = 3000 }: ToastProps) { useEffect(() => { const timer = setTimeout(onClose, duration); return () => clearTimeout(timer); }, [duration, onClose]); const styles = { success: 'bg-green-500 text-white', error: 'bg-red-500 text-white', warning: 'bg-yellow-500 text-white', info: 'bg-blue-500 text-white', }; const icons = { success: 'ri-checkbox-circle-line', error: 'ri-error-warning-line', warning: 'ri-alert-line', info: 'ri-information-line', }; return (

{message}

); }