// Global toast notification system
// Usage from anywhere: window.__toast('success'|'error'|'warning', 'message')
const ToastSystem = () => {
const [toasts, setToasts] = React.useState([]);
const dismiss = React.useCallback((id) => {
setToasts(t => t.filter(x => x.id !== id));
}, []);
React.useEffect(() => {
window.__toast = (type, message, duration = 4500) => {
const id = Date.now() + Math.random();
setToasts(t => [...t, { id, type, message }]);
if (duration > 0) setTimeout(() => dismiss(id), duration);
};
return () => { delete window.__toast; };
}, [dismiss]);
if (!toasts.length) return null;
const iconMap = {
success: