// NotificationsPage — full list view for all notifications (up to API limit of 50). // Использует window.formatDisplay из /dates.js — ISO+UTC → "dd.mm.yyyy HH:MM" в MSK. const { useState: useNotifState, useEffect: useNotifEffect } = React; function NotificationsPage({ onNavigate }) { const [items, setItems] = useNotifState([]); const [loading, setLoading] = useNotifState(true); useNotifEffect(() => { let alive = true; (async () => { try { const data = await api.get('/api/notifications'); if (!alive) return; if (data && data.__unauthorized) return; setItems((data && data.items) || []); } finally { if (alive) setLoading(false); } })(); return () => { alive = false; }; }, []); return (

Уведомления

{loading ? (
Загрузка…
) : items.length === 0 ? (
Уведомлений пока нет
) : (
{items.map(n => (
{n.text}
{formatDisplay(n.created_at)}
))}
)}
); }