/** * Toast notification component * Displays temporary success/error/info messages */ import { useEffect } from 'react'; import { colors, radius, shadows, spacing, typography } from '../theme'; export type ToastType = 'success' | 'error' | 'info' | 'warning'; export interface ToastMessage { id: string; message: string; type: ToastType; duration?: number; } interface ToastProps { message: ToastMessage; onClose: (id: string) => void; } /** * Single toast notification */ export function Toast({ message, onClose }: ToastProps) { useEffect(() => { const timer = setTimeout(() => { onClose(message.id); }, message.duration || 5000); return () => clearTimeout(timer); }, [message.id, message.duration, onClose]); const backgroundColor = { success: colors.success, error: colors.error, info: colors.primary, warning: colors.warning, }[message.type]; const icon = { success: '✓', error: '✕', info: 'ℹ', warning: '⚠', }[message.type]; return (