import { createPortal } from "react-dom"; import { X } from "lucide-react"; import type { ToastItem } from "../../hooks/useToast"; import { useI18n } from "../../i18n"; interface ToastContainerProps { toasts: ToastItem[]; onDismiss: (id: number) => void; } export function ToastContainer({ toasts, onDismiss }: ToastContainerProps) { const { t } = useI18n(); if (toasts.length === 0) { return null; } return createPortal(
{toasts.map((toast) => (
{t(toast.text)}
))}
, document.body, ); }