import React from 'react' import { Bell, CheckCheck, Trash2 } from 'lucide-react' import { useTranslation } from '../i18n' import PageShell from '../components/Layout/PageShell' import HelpAnchor from '../components/Help/HelpAnchor' import EmptyState from '../components/shared/EmptyState' import ConfirmDialog from '../components/shared/ConfirmDialog' import { Spinner } from '../components/shared/Spinner' import NotificationDayList from '../components/Notifications/NotificationDayList' import { useInAppNotifications } from './inAppNotifications/useInAppNotifications' export default function InAppNotificationsPage(): React.ReactElement { // ViewportRoute in App.tsx picks the branch now, so the phone screen is a // chunk of its own instead of a dead limb in this one. return } function InAppNotificationsPageDesktop(): React.ReactElement { const { t } = useTranslation() // Page = wiring container: store, filter, fetch + infinite scroll live in the hook. const { notifications, unreadCount, total, isLoading, hasMore, unreadOnly, setUnreadOnly, loaderRef, displayed, markAllRead, confirmingDeleteAll, requestDeleteAll, cancelDeleteAll, confirmDeleteAll, } = useInAppNotifications() return (
{/* Header: a tile, the name with how many are unread, the count under it, the bulk tools at the end. */}

{t('notifications.title')} {unreadCount > 0 && ( {unreadCount} )}

{total} {t('notifications.countLabel', { count: total })}

{/* Bulk actions */}
{unreadCount > 0 && ( )} {notifications.length > 0 && ( )}
{/* Filter: one segmented control rather than two loose buttons. */}
{/* The list, one card per day. */} {isLoading && displayed.length === 0 ? (
) : displayed.length === 0 ? (
) : ( )} {/* Infinite scroll trigger */} {hasMore && (
{isLoading && }
)}
) }