import React from 'react'; import { createPortal } from 'react-dom'; import { CheckCircle, AlertTriangle, Info, X } from 'lucide-react'; import { useToast } from '../contexts/ToastContext.tsx'; const icons = { success: , error: , info: , }; const toastColors = { success: 'bg-green-50 border-green-200', error: 'bg-red-50 border-red-200', info: 'bg-blue-50 border-blue-200', }; export const ToastContainer: React.FC = () => { const { toasts } = useToast(); const portalElement = document.getElementById('toast-container'); if (!portalElement) return null; return createPortal(
{toasts.map((toast) => (
{icons[toast.type]}

{toast.message}

))}
, portalElement ); };