import React from 'react'; import { useDemoStore } from '../../mock/store'; import { Drawer } from '../../shared/components/Drawer'; import { Button } from '../../shared/components/Button'; import { Bell, AlertTriangle, AlertCircle, CheckCircle2, Info, Check, Trash2 } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; export const NotificationsDrawer: React.FC = () => { const { isNotificationsOpen, setIsNotificationsOpen, notifications, dismissNotification, markAllNotificationsRead, } = useDemoStore(); const navigate = useNavigate(); const getIcon = (type: string) => { switch (type) { case 'danger': return ; case 'warning': return ; case 'success': return ; default: return ; } }; return ( setIsNotificationsOpen(false)} title="Центр внимания и уведомлений" subtitle="Срочные алерты, статус кассы, стоп-листы и опоздания" width="md" footer={ Прочитать все setIsNotificationsOpen(false)}> Закрыть } > {notifications.length === 0 ? ( Нет активных уведомлений. Все системы в норме! ) : ( notifications.map((n) => ( {getIcon(n.type)} {n.title} {n.timestamp} {n.message} {n.actionUrl ? ( { setIsNotificationsOpen(false); navigate(n.actionUrl!); }} className="text-xs text-krona-green font-medium hover:underline" > Перейти к решению → ) : ( )} dismissNotification(n.id)} className="text-krona-secondary hover:text-krona-danger p-1 rounded" title="Удалить" > )) )} ); };
{n.message}