// Simple toast container import { useToast } from "@/hooks/use-toast"; import { Toast } from "./toast"; import { createPortal } from "react-dom"; export function Toaster() { const { toasts, dismiss } = useToast(); if (!toasts.length) return null; // Create a portal to render toasts at the root level return createPortal(
{toasts.map((toast) => ( ))}
, document.body ); }