19 lines
433 B
TypeScript
19 lines
433 B
TypeScript
import type { Toast } from "../hooks/useToast";
|
|
|
|
interface ToastContainerProps {
|
|
toasts: Toast[];
|
|
onRemove: (id: number) => void;
|
|
}
|
|
|
|
export function ToastContainer({ toasts }: ToastContainerProps) {
|
|
return (
|
|
<div className="toast-container" id="toasts">
|
|
{toasts.map((toast) => (
|
|
<div key={toast.id} className={`toast toast-${toast.type}`}>
|
|
{toast.message}
|
|
</div>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|