import React from 'react' import { Bell, CheckCheck, Trash2 } from 'lucide-react' import { useTranslation } from '../i18n' import PageShell from '../components/Layout/PageShell' import { Spinner } from '../components/shared/Spinner' import InAppNotificationItem from '../components/Notifications/InAppNotificationItem.tsx' import { useInAppNotifications } from './inAppNotifications/useInAppNotifications' export default function InAppNotificationsPage(): 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, deleteAll, } = useInAppNotifications() return (
{/* Header */}

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

{total} {total === 1 ? 'notification' : 'notifications'}

{/* Bulk actions */}
{unreadCount > 0 && ( )} {notifications.length > 0 && ( )}
{/* Filter toggle */}
{/* Notification list */}
{isLoading && displayed.length === 0 ? (
) : displayed.length === 0 ? (

{t('notifications.empty')}

{t('notifications.emptyDescription')}

) : ( displayed.map(n => ( )) )} {/* Infinite scroll trigger */} {hasMore && (
{isLoading && }
)}
) }