'use client' import { useEffect } from 'react' import { CheckCircle, XCircle, AlertCircle, X } from 'lucide-react' export type ToastType = 'success' | 'error' | 'info' interface ToastProps { message: string type: ToastType onClose: () => void duration?: number } export default function Toast({ message, type, onClose, duration = 3000 }: ToastProps) { useEffect(() => { if (duration > 0) { console.log(`[Toast] Setting timer for ${duration}ms`) const timer = setTimeout(() => { console.log('[Toast] Auto-dismissing') onClose() }, duration) return () => { console.log('[Toast] Clearing timer') clearTimeout(timer) } } }, [duration, onClose]) const icons = { success: , error: , info: , } const styles = { success: 'bg-green-50 border-green-200 text-green-800', error: 'bg-red-50 border-red-200 text-red-800', info: 'bg-blue-50 border-blue-200 text-blue-800', } return (
{icons[type]}

{message}

) }