import React from 'react' import { createPortal } from 'react-dom' import Toast, { ToastProps } from './Toast' export interface ToastItem extends Omit { id: string } interface ToastContainerProps { toasts: ToastItem[] onRemoveToast: (id: string) => void } const ToastContainer: React.FC = ({ toasts, onRemoveToast }) => { const portalRoot = document.getElementById('toast-root') || document.body return createPortal(
{toasts.map((toast) => ( ))}
, portalRoot ) } export default ToastContainer