@burdenoff/microfe-notification 2026.1118.1 → 2026.1119.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationHistoryAdminPage.js","names":["_Fragment","formatDateTime","value","NotificationHistoryAdminPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotificationAdmin","rescheduleAt","setRescheduleAt","useState","hasPermission","NOTIFICATION_PERMISSIONS","PagePurpose","CalendarClock","NextSteps","notifications","loadNotification","setFilters","prev","exportNotificationsAsCsv","Button","Download","GlassCard","Search","filters","event","topics","topic","EmphasisPanel","isLoading","RefreshCw","IllustratedEmptyState","notification","NotificationCard","scheduledNotifications","scheduled","cancelScheduledNotification","selectedNotification","clearSelection","item","action","Fragment","rescheduleNotification","unarchiveNotification","archiveNotification","events","ShowMore"],"sources":["../../src/pages/NotificationHistoryAdminPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { CalendarClock, Download, RefreshCw, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n ShowMore,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotificationAdmin, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\n\nfunction formatDateTime(value?: string | null) {\n if (!value) return '—';\n return new Date(value).toLocaleString();\n}\n\n/** Admin Notification History — scheduled ops, delivery inspector, event timeline. */\nexport function NotificationHistoryAdminPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { topics } = useNotificationTopics();\n const {\n filters,\n setFilters,\n notifications,\n scheduledNotifications,\n selectedNotification,\n events,\n isLoading,\n loadNotification,\n archiveNotification,\n unarchiveNotification,\n cancelScheduledNotification,\n rescheduleNotification,\n clearSelection,\n } = useNotificationAdmin();\n const [rescheduleAt, setRescheduleAt] = useState('');\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST)) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6\">\n <PagePurpose icon={<CalendarClock size={16} />}>\n {tr(\n 'notifications.adminHistoryPurpose',\n 'The operations console for everything your team has sent. Audit delivery outcomes (delivered, opened, clicked, failed, unsubscribed), inspect a single notification’s full event timeline, and manage the schedule — reschedule or cancel anything still pending. Use it to debug a campaign or prove a notification went out.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"notification-admin-history\"\n steps={[\n {\n id: 'inspect',\n label: tr('notifications.nextInspectLabel', 'Inspect a delivery'),\n description: tr(\n 'notifications.nextInspectDesc',\n 'Click any notification to see its receipts, opens, clicks and full event timeline.'\n ),\n onClick: () => {\n if (notifications[0]) {\n loadNotification(notifications[0].id);\n }\n },\n },\n {\n id: 'failed',\n label: tr('notifications.nextFailedLabel', 'Find failed deliveries'),\n description: tr(\n 'notifications.nextFailedDesc',\n 'Filter by a FAILED delivery state to triage what did not reach recipients.'\n ),\n onClick: () => setFilters((prev) => ({ ...prev, deliveryStatus: 'FAILED' })),\n },\n {\n id: 'export',\n label: tr('notifications.nextExportLabel', 'Export the current view'),\n description: tr(\n 'notifications.nextExportDesc',\n 'Download the filtered results as CSV for reporting or an external audit.'\n ),\n onClick: () => {\n if (notifications.length > 0) {\n exportNotificationsAsCsv(tr, notifications);\n }\n },\n },\n ]}\n />\n\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.adminHistoryTitle', 'Notification Operations')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr(\n 'notifications.adminHistorySubtitle',\n 'Review sent and scheduled notifications, delivery outcomes, opens, clicks, and user activity.'\n )}\n </p>\n </div>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"grid gap-3 border-border-seam p-4 lg:grid-cols-6\">\n <label className=\"relative lg:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={filters.search}\n onChange={(event) => setFilters((prev) => ({ ...prev, search: event.target.value }))}\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n className=\"w-full rounded-md border border-default bg-bg-canvas py-2 pl-9 pr-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <select\n value={filters.status}\n onChange={(event) => setFilters((prev) => ({ ...prev, status: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allStatuses', 'All Statuses')}</option>\n <option value=\"PENDING\">PENDING</option>\n <option value=\"TRIGGERED\">TRIGGERED</option>\n <option value=\"SENT\">SENT</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"CANCELLED\">CANCELLED</option>\n </select>\n\n <select\n value={filters.channel}\n onChange={(event) => setFilters((prev) => ({ ...prev, channel: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allChannels', 'All Channels')}</option>\n <option value=\"EMAIL\">EMAIL</option>\n <option value=\"SMS\">SMS</option>\n <option value=\"PUSH\">PUSH</option>\n <option value=\"WHATSAPP\">WHATSAPP</option>\n <option value=\"IN_APP\">IN_APP</option>\n </select>\n\n <select\n value={filters.deliveryStatus}\n onChange={(event) =>\n setFilters((prev) => ({ ...prev, deliveryStatus: event.target.value }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allDeliveryStates', 'All Delivery')}</option>\n <option value=\"DELIVERED\">DELIVERED</option>\n <option value=\"OPENED\">OPENED</option>\n <option value=\"CLICKED\">CLICKED</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"UNSUBSCRIBED\">UNSUBSCRIBED</option>\n </select>\n\n <select\n value={filters.topicId}\n onChange={(event) => setFilters((prev) => ({ ...prev, topicId: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n <select\n value={filters.archived}\n onChange={(event) =>\n setFilters((prev) => ({\n ...prev,\n archived: event.target.value as typeof prev.archived,\n }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.activeAndArchived', 'Active + Archived')}</option>\n <option value=\"active\">{tr('notifications.activeOnly', 'Active Only')}</option>\n <option value=\"archived\">{tr('notifications.archivedOnly', 'Archived Only')}</option>\n </select>\n </GlassCard>\n\n <div className=\"grid gap-6 xl:grid-cols-[minmax(0,1fr),420px]\">\n <div className=\"space-y-6\">\n {/* Single emphasis zone — the live results list is the heart of this console. */}\n <EmphasisPanel className=\"p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div>\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.sentNotifications', 'Notifications')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {notifications.length} {tr('notifications.resultsFoundShort', 'results')}\n </p>\n </div>\n {isLoading && <RefreshCw size={16} className=\"animate-spin text-tertiary\" />}\n </div>\n\n <div className=\"space-y-3\">\n {notifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={tr(\n 'notifications.adjustSearchOrDateRange',\n 'Try adjusting your filters'\n )}\n />\n ) : (\n notifications.map((notification) => (\n <button\n key={notification.id}\n type=\"button\"\n onClick={() => loadNotification(notification.id)}\n className=\"block w-full text-left\"\n >\n <NotificationCard\n notification={notification}\n compact\n showArchivedState\n analyticsSource=\"admin_history\"\n />\n </button>\n ))\n )}\n </div>\n </EmphasisPanel>\n\n <section className=\"rounded-lg border border-border-seam bg-gloss-card p-4\">\n <div className=\"mb-4 flex items-center gap-2\">\n <CalendarClock size={18} className=\"text-accent-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.scheduledNotifications', 'Scheduled Notifications')}\n </h2>\n </div>\n\n <div className=\"space-y-3\">\n {scheduledNotifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('notifications.noScheduledNotifications', 'No scheduled notifications')}\n description={tr(\n 'notifications.noScheduledDescription',\n 'Notifications queued for a future send time will appear here, ready to reschedule or cancel.'\n )}\n />\n ) : (\n scheduledNotifications.map((scheduled) => (\n <div\n key={scheduled.id}\n className=\"rounded-md border border-default bg-bg-canvas p-4\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h3 className=\"text-sm font-semibold text-primary\">\n {scheduled.notification.title}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {scheduled.notification.channel} • {scheduled.notification.type} •{' '}\n {formatDateTime(scheduled.scheduledFor)}\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => loadNotification(scheduled.notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.view', 'View')}\n </button>\n {scheduled.status === 'PENDING' && (\n <button\n type=\"button\"\n onClick={() => cancelScheduledNotification(scheduled.id)}\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n </div>\n </section>\n </div>\n\n <aside className=\"rounded-lg border border-border-seam bg-gloss-card p-4 xl:sticky xl:top-4 xl:max-h-[calc(100vh-2rem)] xl:self-start xl:overflow-y-auto\">\n {selectedNotification ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold text-primary\">\n {selectedNotification.title}\n </h2>\n <p className=\"text-sm text-text-secondary\">{selectedNotification.body}</p>\n </div>\n <button\n type=\"button\"\n onClick={clearSelection}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.close', 'Close')}\n </button>\n </div>\n\n <div className=\"grid gap-2 rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\">\n <div>\n <strong>{tr('notifications.detail.status', 'Status')}:</strong>{' '}\n {selectedNotification.status}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivery', 'Delivery')}:</strong>{' '}\n {selectedNotification.deliveryStatus || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.topic', 'Topic')}:</strong>{' '}\n {selectedNotification.topic?.name || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.created', 'Created')}:</strong>{' '}\n {formatDateTime(selectedNotification.createdAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.sent', 'Sent')}:</strong>{' '}\n {formatDateTime(selectedNotification.sentAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivered', 'Delivered')}:</strong>{' '}\n {formatDateTime(selectedNotification.deliveredAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.opened', 'Opened')}:</strong>{' '}\n {formatDateTime(selectedNotification.openedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.clicked', 'Clicked')}:</strong>{' '}\n {formatDateTime(selectedNotification.clickedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.read', 'Read')}:</strong>{' '}\n {formatDateTime(selectedNotification.readAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.recipient', 'Recipient')}:</strong>{' '}\n {selectedNotification.recipientEmail ||\n selectedNotification.recipientPhone ||\n selectedNotification.id}\n </div>\n </div>\n\n {selectedNotification.media.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.media', 'Media')}\n </h3>\n <div className=\"grid gap-3\">\n {selectedNotification.media.map((item) => (\n <a\n key={item.url}\n href={item.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-accent-primary hover:underline\"\n >\n {item.label || item.url}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.actions.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.actions', 'Actions')}\n </h3>\n <div className=\"grid gap-2\">\n {selectedNotification.actions.map((action) => (\n <div\n key={action.id}\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{action.label}</div>\n <div className=\"truncate text-xs\">{action.url}</div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.scheduledNotification && (\n <div className=\"space-y-3 rounded-md border border-default bg-bg-canvas p-3\">\n <div className=\"text-sm font-semibold text-primary\">\n {tr('notifications.scheduling', 'Scheduling')}\n </div>\n <div className=\"text-sm text-text-secondary\">\n {formatDateTime(selectedNotification.scheduledNotification.scheduledFor)}\n </div>\n {selectedNotification.scheduledNotification.status === 'PENDING' && (\n <>\n <input\n type=\"datetime-local\"\n value={rescheduleAt}\n onChange={(event) => setRescheduleAt(event.target.value)}\n className=\"w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() =>\n rescheduleAt &&\n rescheduleNotification(\n selectedNotification.scheduledNotification!.id,\n new Date(rescheduleAt).toISOString()\n )\n }\n className=\"rounded-md bg-accent-primary px-3 py-2 text-xs font-medium text-text-inverse hover:opacity-90\"\n >\n {tr('notifications.reschedule', 'Reschedule')}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n cancelScheduledNotification(\n selectedNotification.scheduledNotification!.id\n )\n }\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n </div>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex items-center gap-2\">\n {selectedNotification.archivedAt ? (\n <button\n type=\"button\"\n onClick={() => unarchiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={() => archiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.archive', 'Archive')}\n </button>\n )}\n </div>\n\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.eventTimeline', 'Event Timeline')}\n </h3>\n {events.length === 0 ? (\n <div className=\"rounded-md border border-dashed border-border-seam p-4 text-sm text-text-secondary\">\n {tr('notifications.noEvents', 'No events recorded yet.')}\n </div>\n ) : (\n <ShowMore collapsedHeight={180}>\n <div className=\"space-y-2\">\n {events.map((event) => (\n <div\n key={event.id}\n className=\"rounded-md border border-border-seam bg-surface p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{event.eventType}</div>\n <div>{formatDateTime(event.timestamp)}</div>\n {event.deliveryStatus && (\n <div>\n {tr('notifications.detail.delivery', 'Delivery')}:{' '}\n {event.deliveryStatus}\n </div>\n )}\n </div>\n ))}\n </div>\n </ShowMore>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex h-full min-h-[360px] items-center justify-center\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.selectNotificationTitle', 'Nothing selected')}\n description={tr(\n 'notifications.selectNotificationForDetails',\n 'Select a notification to inspect details, delivery receipts, and activity.'\n )}\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAASC,EAAe,GAAuB;CAE7C,OADKC,IACE,IAAI,KAAKA,CAAK,CAAC,CAAC,eAAe,IADnB;AAErB;AAGA,SAAgBC,IAA+B;CAC7C,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,cAAWC,EAAsB,GACnC,EACJ,YACA,eACA,kBACA,2BACA,yBACA,WACA,cACA,qBACA,wBACA,0BACA,gCACA,2BACA,sBACEC,EAAqB,GACnB,CAACC,GAAcC,KAAmBC,EAAS,EAAE;CAqBnD,OAnBIN,IAEA,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA,IAIJO,EAAcC,EAAyB,iBAAiB,IAY3D,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACC,GAAD;IAAa,MA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U;SACX,UAAAA,EAAG,+BAA+B,gBAAgB;QACjD,CAAA,GACH4C,EAAO,WAAW,IACjB,kBAAC,OAAD;SAAK,WAAU;SACZ,UAAA5C,EAAG,0BAA0B,yBAAyB;QACpD,CAAA,IAEL,kBAAC6C,GAAD;SAAU,iBAAiB;SACzB,UAAA,kBAAC,OAAD;UAAK,WAAU;UACZ,UAAAD,EAAO,KAAK,MACX,kBAAC,OAAD;WAEE,WAAU;WAFZ,UAAA;YAIE,kBAAC,OAAD;aAAK,WAAU;aAA4B,UAAApB,EAAM;YAAe,CAAA;YAChE,kBAAC,OAAD,EAAA,UAAM3B,EAAe2B,EAAM,SAAS,EAAO,CAAA;YAC1CA,EAAM,kBACL,kBAAC,OAAD,EAAA,UAAA;aACGxB,EAAG,iCAAiC,UAAU;aAAE;aAAE;aAClDwB,EAAM;YACJ,EAAA,CAAA;WAEJ;UAXE,GAAAA,EAAM,EAWR,CACN;SACE,CAAA;QACG,CAAA,CAET;;MACF;KAEL,CAAA,IAAA,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAACM,GAAD;OACE,cAAa;OACb,OAAO9B,EAAG,yCAAyC,kBAAkB;OACrE,aAAaA,EACX,8CACA,4EACF;MACD,CAAA;KACE,CAAA;IAEF,CAAA,CACJ;;EACF;C,KA1eH,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAA,EACC,qCACA,yDACF;CACG,CAAA;AAueX"}
1
+ {"version":3,"file":"NotificationHistoryAdminPage.js","names":["_Fragment","formatDateTime","value","NotificationHistoryAdminPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotificationAdmin","rescheduleAt","setRescheduleAt","useState","hasPermission","NOTIFICATION_PERMISSIONS","PagePurpose","CalendarClock","NextSteps","notifications","loadNotification","setFilters","prev","exportNotificationsAsCsv","Button","Download","GlassCard","Search","filters","event","ThemedSelect","topics","topic","EmphasisPanel","isLoading","RefreshCw","IllustratedEmptyState","notification","NotificationCard","scheduledNotifications","scheduled","cancelScheduledNotification","selectedNotification","clearSelection","item","action","Fragment","rescheduleNotification","unarchiveNotification","archiveNotification","events","ShowMore"],"sources":["../../src/pages/NotificationHistoryAdminPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { CalendarClock, Download, RefreshCw, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n ShowMore,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotificationAdmin, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\n\nfunction formatDateTime(value?: string | null) {\n if (!value) return '—';\n return new Date(value).toLocaleString();\n}\n\n/** Admin Notification History — scheduled ops, delivery inspector, event timeline. */\nexport function NotificationHistoryAdminPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { topics } = useNotificationTopics();\n const {\n filters,\n setFilters,\n notifications,\n scheduledNotifications,\n selectedNotification,\n events,\n isLoading,\n loadNotification,\n archiveNotification,\n unarchiveNotification,\n cancelScheduledNotification,\n rescheduleNotification,\n clearSelection,\n } = useNotificationAdmin();\n const [rescheduleAt, setRescheduleAt] = useState('');\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST)) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6\">\n <PagePurpose icon={<CalendarClock size={16} />}>\n {tr(\n 'notifications.adminHistoryPurpose',\n 'The operations console for everything your team has sent. Audit delivery outcomes (delivered, opened, clicked, failed, unsubscribed), inspect a single notification’s full event timeline, and manage the schedule — reschedule or cancel anything still pending. Use it to debug a campaign or prove a notification went out.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"notification-admin-history\"\n steps={[\n {\n id: 'inspect',\n label: tr('notifications.nextInspectLabel', 'Inspect a delivery'),\n description: tr(\n 'notifications.nextInspectDesc',\n 'Click any notification to see its receipts, opens, clicks and full event timeline.'\n ),\n onClick: () => {\n if (notifications[0]) {\n loadNotification(notifications[0].id);\n }\n },\n },\n {\n id: 'failed',\n label: tr('notifications.nextFailedLabel', 'Find failed deliveries'),\n description: tr(\n 'notifications.nextFailedDesc',\n 'Filter by a FAILED delivery state to triage what did not reach recipients.'\n ),\n onClick: () => setFilters((prev) => ({ ...prev, deliveryStatus: 'FAILED' })),\n },\n {\n id: 'export',\n label: tr('notifications.nextExportLabel', 'Export the current view'),\n description: tr(\n 'notifications.nextExportDesc',\n 'Download the filtered results as CSV for reporting or an external audit.'\n ),\n onClick: () => {\n if (notifications.length > 0) {\n exportNotificationsAsCsv(tr, notifications);\n }\n },\n },\n ]}\n />\n\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.adminHistoryTitle', 'Notification Operations')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr(\n 'notifications.adminHistorySubtitle',\n 'Review sent and scheduled notifications, delivery outcomes, opens, clicks, and user activity.'\n )}\n </p>\n </div>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"grid gap-3 border-border-seam p-4 lg:grid-cols-6\">\n <label className=\"relative lg:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={filters.search}\n onChange={(event) => setFilters((prev) => ({ ...prev, search: event.target.value }))}\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n className=\"w-full rounded-md border border-default bg-bg-canvas py-2 pl-9 pr-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <ThemedSelect\n value={filters.status}\n onChange={(event) => setFilters((prev) => ({ ...prev, status: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allStatuses', 'All Statuses')}</option>\n <option value=\"PENDING\">PENDING</option>\n <option value=\"TRIGGERED\">TRIGGERED</option>\n <option value=\"SENT\">SENT</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"CANCELLED\">CANCELLED</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.channel}\n onChange={(event) => setFilters((prev) => ({ ...prev, channel: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allChannels', 'All Channels')}</option>\n <option value=\"EMAIL\">EMAIL</option>\n <option value=\"SMS\">SMS</option>\n <option value=\"PUSH\">PUSH</option>\n <option value=\"WHATSAPP\">WHATSAPP</option>\n <option value=\"IN_APP\">IN_APP</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.deliveryStatus}\n onChange={(event) =>\n setFilters((prev) => ({ ...prev, deliveryStatus: event.target.value }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allDeliveryStates', 'All Delivery')}</option>\n <option value=\"DELIVERED\">DELIVERED</option>\n <option value=\"OPENED\">OPENED</option>\n <option value=\"CLICKED\">CLICKED</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"UNSUBSCRIBED\">UNSUBSCRIBED</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.topicId}\n onChange={(event) => setFilters((prev) => ({ ...prev, topicId: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.archived}\n onChange={(event) =>\n setFilters((prev) => ({\n ...prev,\n archived: event.target.value as typeof prev.archived,\n }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.activeAndArchived', 'Active + Archived')}</option>\n <option value=\"active\">{tr('notifications.activeOnly', 'Active Only')}</option>\n <option value=\"archived\">{tr('notifications.archivedOnly', 'Archived Only')}</option>\n </ThemedSelect>\n </GlassCard>\n\n <div className=\"grid gap-6 xl:grid-cols-[minmax(0,1fr),420px]\">\n <div className=\"space-y-6\">\n {/* Single emphasis zone — the live results list is the heart of this console. */}\n <EmphasisPanel className=\"p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div>\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.sentNotifications', 'Notifications')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {notifications.length} {tr('notifications.resultsFoundShort', 'results')}\n </p>\n </div>\n {isLoading && <RefreshCw size={16} className=\"animate-spin text-tertiary\" />}\n </div>\n\n <div className=\"space-y-3\">\n {notifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={tr(\n 'notifications.adjustSearchOrDateRange',\n 'Try adjusting your filters'\n )}\n />\n ) : (\n notifications.map((notification) => (\n <button\n key={notification.id}\n type=\"button\"\n onClick={() => loadNotification(notification.id)}\n className=\"block w-full text-left\"\n >\n <NotificationCard\n notification={notification}\n compact\n showArchivedState\n analyticsSource=\"admin_history\"\n />\n </button>\n ))\n )}\n </div>\n </EmphasisPanel>\n\n <section className=\"rounded-lg border border-border-seam bg-gloss-card p-4\">\n <div className=\"mb-4 flex items-center gap-2\">\n <CalendarClock size={18} className=\"text-accent-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.scheduledNotifications', 'Scheduled Notifications')}\n </h2>\n </div>\n\n <div className=\"space-y-3\">\n {scheduledNotifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('notifications.noScheduledNotifications', 'No scheduled notifications')}\n description={tr(\n 'notifications.noScheduledDescription',\n 'Notifications queued for a future send time will appear here, ready to reschedule or cancel.'\n )}\n />\n ) : (\n scheduledNotifications.map((scheduled) => (\n <div\n key={scheduled.id}\n className=\"rounded-md border border-default bg-bg-canvas p-4\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h3 className=\"text-sm font-semibold text-primary\">\n {scheduled.notification.title}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {scheduled.notification.channel} • {scheduled.notification.type} •{' '}\n {formatDateTime(scheduled.scheduledFor)}\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => loadNotification(scheduled.notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.view', 'View')}\n </button>\n {scheduled.status === 'PENDING' && (\n <button\n type=\"button\"\n onClick={() => cancelScheduledNotification(scheduled.id)}\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n </div>\n </section>\n </div>\n\n <aside className=\"rounded-lg border border-border-seam bg-gloss-card p-4 xl:sticky xl:top-4 xl:max-h-[calc(100vh-2rem)] xl:self-start xl:overflow-y-auto\">\n {selectedNotification ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold text-primary\">\n {selectedNotification.title}\n </h2>\n <p className=\"text-sm text-text-secondary\">{selectedNotification.body}</p>\n </div>\n <button\n type=\"button\"\n onClick={clearSelection}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.close', 'Close')}\n </button>\n </div>\n\n <div className=\"grid gap-2 rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\">\n <div>\n <strong>{tr('notifications.detail.status', 'Status')}:</strong>{' '}\n {selectedNotification.status}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivery', 'Delivery')}:</strong>{' '}\n {selectedNotification.deliveryStatus || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.topic', 'Topic')}:</strong>{' '}\n {selectedNotification.topic?.name || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.created', 'Created')}:</strong>{' '}\n {formatDateTime(selectedNotification.createdAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.sent', 'Sent')}:</strong>{' '}\n {formatDateTime(selectedNotification.sentAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivered', 'Delivered')}:</strong>{' '}\n {formatDateTime(selectedNotification.deliveredAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.opened', 'Opened')}:</strong>{' '}\n {formatDateTime(selectedNotification.openedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.clicked', 'Clicked')}:</strong>{' '}\n {formatDateTime(selectedNotification.clickedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.read', 'Read')}:</strong>{' '}\n {formatDateTime(selectedNotification.readAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.recipient', 'Recipient')}:</strong>{' '}\n {selectedNotification.recipientEmail ||\n selectedNotification.recipientPhone ||\n selectedNotification.id}\n </div>\n </div>\n\n {selectedNotification.media.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.media', 'Media')}\n </h3>\n <div className=\"grid gap-3\">\n {selectedNotification.media.map((item) => (\n <a\n key={item.url}\n href={item.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-accent-primary hover:underline\"\n >\n {item.label || item.url}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.actions.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.actions', 'Actions')}\n </h3>\n <div className=\"grid gap-2\">\n {selectedNotification.actions.map((action) => (\n <div\n key={action.id}\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{action.label}</div>\n <div className=\"truncate text-xs\">{action.url}</div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.scheduledNotification && (\n <div className=\"space-y-3 rounded-md border border-default bg-bg-canvas p-3\">\n <div className=\"text-sm font-semibold text-primary\">\n {tr('notifications.scheduling', 'Scheduling')}\n </div>\n <div className=\"text-sm text-text-secondary\">\n {formatDateTime(selectedNotification.scheduledNotification.scheduledFor)}\n </div>\n {selectedNotification.scheduledNotification.status === 'PENDING' && (\n <>\n <input\n type=\"datetime-local\"\n value={rescheduleAt}\n onChange={(event) => setRescheduleAt(event.target.value)}\n className=\"w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() =>\n rescheduleAt &&\n rescheduleNotification(\n selectedNotification.scheduledNotification!.id,\n new Date(rescheduleAt).toISOString()\n )\n }\n className=\"rounded-md bg-accent-primary px-3 py-2 text-xs font-medium text-text-inverse hover:opacity-90\"\n >\n {tr('notifications.reschedule', 'Reschedule')}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n cancelScheduledNotification(\n selectedNotification.scheduledNotification!.id\n )\n }\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n </div>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex items-center gap-2\">\n {selectedNotification.archivedAt ? (\n <button\n type=\"button\"\n onClick={() => unarchiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={() => archiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.archive', 'Archive')}\n </button>\n )}\n </div>\n\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.eventTimeline', 'Event Timeline')}\n </h3>\n {events.length === 0 ? (\n <div className=\"rounded-md border border-dashed border-border-seam p-4 text-sm text-text-secondary\">\n {tr('notifications.noEvents', 'No events recorded yet.')}\n </div>\n ) : (\n <ShowMore collapsedHeight={180}>\n <div className=\"space-y-2\">\n {events.map((event) => (\n <div\n key={event.id}\n className=\"rounded-md border border-border-seam bg-surface p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{event.eventType}</div>\n <div>{formatDateTime(event.timestamp)}</div>\n {event.deliveryStatus && (\n <div>\n {tr('notifications.detail.delivery', 'Delivery')}:{' '}\n {event.deliveryStatus}\n </div>\n )}\n </div>\n ))}\n </div>\n </ShowMore>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex h-full min-h-[360px] items-center justify-center\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.selectNotificationTitle', 'Nothing selected')}\n description={tr(\n 'notifications.selectNotificationForDetails',\n 'Select a notification to inspect details, delivery receipts, and activity.'\n )}\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,SAASC,EAAe,GAAuB;CAE7C,OADKC,IACE,IAAI,KAAKA,CAAK,CAAC,CAAC,eAAe,IADnB;AAErB;AAGA,SAAgBC,IAA+B;CAC7C,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,cAAWC,EAAsB,GACnC,EACJ,YACA,eACA,kBACA,2BACA,yBACA,WACA,cACA,qBACA,wBACA,0BACA,gCACA,2BACA,sBACEC,EAAqB,GACnB,CAACC,GAAcC,KAAmBC,EAAS,EAAE;CAqBnD,OAnBIN,IAEA,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA,IAIJO,EAAcC,EAAyB,iBAAiB,IAY3D,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACC,GAAD;IAAa,MAAM,kBAACC,GAAD,EAAe,MAAM,GAAK,CAAA;IAC1C,UAAAZ,EACC,qCACA,gUACF;GACW,CAAA;GAEb,kBAACa,GAAD;IACE,YAAW;IACX,OAAO;KACL;MACE,IAAI;MACJ,OAAOb,EAAG,kCAAkC,oBAAoB;MAChE,aAAaA,EACX,iCACA,oFACF;MACA,eAAe;OACb,AAAIc,EAAc,MAChBC,EAAiBD,EAAc,EAAE,CAAC,EAAE;MAExC;KACF;KACA;MACE,IAAI;MACJ,OAAOd,EAAG,iCAAiC,wBAAwB;MACnE,aAAaA,EACX,gCACA,4EACF;MACA,eAAegB,GAAY,OAA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2B,EAAM,SAAS,EAAO,CAAA;YAC1CA,EAAM,kBACL,kBAAC,OAAD,EAAA,UAAA;aACGxB,EAAG,iCAAiC,UAAU;aAAE;aAAE;aAClDwB,EAAM;YACJ,EAAA,CAAA;WAEJ;UAXE,GAAAA,EAAM,EAWR,CACN;SACE,CAAA;QACG,CAAA,CAET;;MACF;KAEL,CAAA,IAAA,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAACO,GAAD;OACE,cAAa;OACb,OAAO/B,EAAG,yCAAyC,kBAAkB;OACrE,aAAaA,EACX,8CACA,4EACF;MACD,CAAA;KACE,CAAA;IAEF,CAAA,CACJ;;EACF;C,KA1eH,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAA,EACC,qCACA,yDACF;CACG,CAAA;AAueX"}
@@ -11,22 +11,22 @@ import { NotificationArchivedV2 as c } from "../navigation-v2/NotificationArchiv
11
11
  import { usePermissions as l } from "@burdenoff/fe-libs/shared/providers/shell";
12
12
  import { Download as u, History as d, Search as f } from "lucide-react";
13
13
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
14
- import { Button as h, EmphasisPanel as g, GlassCard as _, IllustratedEmptyState as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
14
+ import { Button as h, EmphasisPanel as g, GlassCard as _, IllustratedEmptyState as v, PagePurpose as y, ThemedSelect as b } from "@burdenoff/fe-libs/ui";
15
15
  // src/pages/NotificationHistoryPage.tsx
16
- var b = {
16
+ var x = {
17
17
  archived: null,
18
18
  channel: "ALL"
19
19
  };
20
- function x() {
20
+ function S() {
21
21
  let { navigationV2: e } = a();
22
- return p(e ? c : S, {});
22
+ return p(e ? c : C, {});
23
23
  }
24
- function S() {
25
- let c = o(), { hasPermission: x, isLoading: S } = l(), { currentUser: C } = a(), { topics: w } = n({ isActive: !0 }), { notifications: T, hasMore: E, isLoadingMore: D, loadMore: O, notificationFilter: k, updateFilter: A, archiveNotification: j, unarchiveNotification: M, recordAction: N } = t({ baseFilter: b }), P = !!(k.search || k.topicId || k.dateRange.start || k.dateRange.end);
26
- return S ? /* @__PURE__ */ p("div", {
24
+ function C() {
25
+ let c = o(), { hasPermission: S, isLoading: C } = l(), { currentUser: w } = a(), { topics: T } = n({ isActive: !0 }), { notifications: E, hasMore: D, isLoadingMore: O, loadMore: k, notificationFilter: A, updateFilter: j, archiveNotification: M, unarchiveNotification: N, recordAction: P } = t({ baseFilter: x }), F = !!(A.search || A.topicId || A.dateRange.start || A.dateRange.end);
26
+ return C ? /* @__PURE__ */ p("div", {
27
27
  className: "flex h-64 items-center justify-center",
28
28
  children: /* @__PURE__ */ p("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
29
- }) : !x(i.NOTIFICATION_LIST) && !C?.id ? /* @__PURE__ */ p("div", {
29
+ }) : !S(i.NOTIFICATION_LIST) && !w?.id ? /* @__PURE__ */ p("div", {
30
30
  className: "p-8 text-center text-text-secondary",
31
31
  children: c("notifications.noPermissionHistory", "You don't have permission to view notification history.")
32
32
  }) : /* @__PURE__ */ m("div", {
@@ -48,8 +48,8 @@ function S() {
48
48
  })] }), /* @__PURE__ */ m(h, {
49
49
  "data-tour": "notification-history-export",
50
50
  variant: "outline",
51
- onClick: () => s(c, T),
52
- disabled: T.length === 0,
51
+ onClick: () => s(c, E),
52
+ disabled: E.length === 0,
53
53
  className: "gap-2",
54
54
  children: [/* @__PURE__ */ p(u, { size: 16 }), c("notifications.export", "Export")]
55
55
  })]
@@ -66,19 +66,19 @@ function S() {
66
66
  }), /* @__PURE__ */ p("input", {
67
67
  type: "text",
68
68
  placeholder: c("notifications.searchByTitleOrContent", "Search by title or content..."),
69
- value: k.search,
70
- onChange: (e) => A({ search: e.target.value }),
69
+ value: A.search,
70
+ onChange: (e) => j({ search: e.target.value }),
71
71
  className: "w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150"
72
72
  })]
73
73
  }),
74
- /* @__PURE__ */ m("select", {
75
- value: k.topicId || "",
76
- onChange: (e) => A({ topicId: e.target.value || void 0 }),
74
+ /* @__PURE__ */ m(b, {
75
+ value: A.topicId || "",
76
+ onChange: (e) => j({ topicId: e.target.value || void 0 }),
77
77
  className: "rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
78
78
  children: [/* @__PURE__ */ p("option", {
79
79
  value: "",
80
80
  children: c("notifications.allTopics", "All Topics")
81
- }), w.map((e) => /* @__PURE__ */ p("option", {
81
+ }), T.map((e) => /* @__PURE__ */ p("option", {
82
82
  value: e.id,
83
83
  children: e.name
84
84
  }, e.id))]
@@ -86,9 +86,9 @@ function S() {
86
86
  /* @__PURE__ */ p("input", {
87
87
  type: "date",
88
88
  "aria-label": c("notifications.startDate", "Start date"),
89
- value: k.dateRange.start ? k.dateRange.start.toISOString().split("T")[0] : "",
90
- onChange: (e) => A({ dateRange: {
91
- ...k.dateRange,
89
+ value: A.dateRange.start ? A.dateRange.start.toISOString().split("T")[0] : "",
90
+ onChange: (e) => j({ dateRange: {
91
+ ...A.dateRange,
92
92
  start: e.target.value ? new Date(e.target.value) : null
93
93
  } }),
94
94
  className: "rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary"
@@ -96,9 +96,9 @@ function S() {
96
96
  /* @__PURE__ */ p("input", {
97
97
  type: "date",
98
98
  "aria-label": c("notifications.endDate", "End date"),
99
- value: k.dateRange.end ? k.dateRange.end.toISOString().split("T")[0] : "",
100
- onChange: (e) => A({ dateRange: {
101
- ...k.dateRange,
99
+ value: A.dateRange.end ? A.dateRange.end.toISOString().split("T")[0] : "",
100
+ onChange: (e) => j({ dateRange: {
101
+ ...A.dateRange,
102
102
  end: e.target.value ? new Date(e.target.value) : null
103
103
  } }),
104
104
  className: "rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary"
@@ -107,18 +107,18 @@ function S() {
107
107
  }),
108
108
  /* @__PURE__ */ p("div", {
109
109
  className: "space-y-2",
110
- children: T.length > 0 ? T.map((t) => /* @__PURE__ */ m("div", {
110
+ children: E.length > 0 ? E.map((t) => /* @__PURE__ */ m("div", {
111
111
  className: "space-y-2",
112
112
  children: [/* @__PURE__ */ p(e, {
113
113
  notification: t,
114
- onArchive: j,
115
- onAction: N,
114
+ onArchive: M,
115
+ onAction: P,
116
116
  showArchivedState: !0,
117
117
  analyticsSource: "history"
118
118
  }), t.archivedAt && /* @__PURE__ */ p("div", {
119
119
  className: "flex justify-end",
120
120
  children: /* @__PURE__ */ p("button", {
121
- onClick: () => M(t.id),
121
+ onClick: () => N(t.id),
122
122
  className: "rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken",
123
123
  children: c("notifications.restore", "Restore")
124
124
  })
@@ -126,21 +126,21 @@ function S() {
126
126
  }, t.id)) : /* @__PURE__ */ p("div", {
127
127
  className: "animate-in fade-in duration-200",
128
128
  children: /* @__PURE__ */ p(v, {
129
- illustration: P ? "empty-search" : "empty-notifications",
130
- title: P ? c("notifications.noNotificationsFound", "No notifications found") : c("notifications.historyEmptyTitle", "No history yet"),
131
- description: P ? c("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : c("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again.")
129
+ illustration: F ? "empty-search" : "empty-notifications",
130
+ title: F ? c("notifications.noNotificationsFound", "No notifications found") : c("notifications.historyEmptyTitle", "No history yet"),
131
+ description: F ? c("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : c("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again.")
132
132
  })
133
133
  })
134
134
  }),
135
135
  /* @__PURE__ */ p(r, {
136
- hasMore: E,
137
- isLoadingMore: D,
138
- onLoadMore: O,
139
- shownCount: T.length
136
+ hasMore: D,
137
+ isLoadingMore: O,
138
+ onLoadMore: k,
139
+ shownCount: E.length
140
140
  })
141
141
  ]
142
142
  });
143
143
  }
144
- export { x as NotificationHistoryPage };
144
+ export { S as NotificationHistoryPage };
145
145
 
146
146
  //# sourceMappingURL=NotificationHistoryPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationHistoryPage.js","names":["HISTORY_FILTER","NotificationHistoryPage","useNotification","jsx","navigationV2","NotificationArchivedV2","ClassicNotificationHistoryPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotifications","hasActiveFilters","notificationFilter","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","History","EmphasisPanel","Button","exportNotificationsAsCsv","notifications","Download","GlassCard","Search","updateFilter","event","topics","topic","NotificationCard","archiveNotification","recordAction","notification","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Download, History, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { NotificationArchivedV2 } from '../navigation-v2/NotificationArchivedV2';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/**\n * User Notification History — personal history, filter, CSV export,\n * archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the\n * \"Archived\" view instead; every other app keeps this page.\n */\nexport function NotificationHistoryPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationArchivedV2 /> : <ClassicNotificationHistoryPage />;\n}\n\nfunction ClassicNotificationHistoryPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n\n const hasActiveFilters = Boolean(\n notificationFilter.search ||\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<History size={16} />}>\n {tr(\n 'notifications.historyPurpose',\n 'A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.'\n )}\n </PagePurpose>\n\n {/* Single emphasis zone — the header summary + the one export CTA. */}\n <EmphasisPanel\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.historyTitle', 'Notification History')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('notifications.historySubtitle', 'View and search all your notifications')}\n </p>\n </div>\n\n <Button\n data-tour=\"notification-history-export\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </EmphasisPanel>\n\n <GlassCard\n treatment=\"plain\"\n className=\"grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5\"\n >\n <div className=\"relative sm:col-span-2 xl:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(event) => updateFilter({ topicId: event.target.value || undefined })}\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n <input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={\n notificationFilter.dateRange.start\n ? notificationFilter.dateRange.start.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n\n <input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={\n notificationFilter.dateRange.end\n ? notificationFilter.dateRange.end.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n </GlassCard>\n\n <div className=\"space-y-2\">\n {notifications.length > 0 ? (\n notifications.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <button\n onClick={() => unarchiveNotification(notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={notifications.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe;AAOjE,SAAgBC,IAA0B;CACxC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAqC;AACtF;AAEA,SAASA,IAAiC;CACxC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EAAE,cAAWS,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,EACJ,kBACA,YACA,kBACA,aACA,uBACA,iBACA,wBACA,0BACA,oBACEC,EAAiB,EAAE,YAAYZ,EAAe,CAAC,GAE7Ca,IAAmB,GACv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A,GACAC,EAAa,cACZ,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAAC,UAAD;OACE,eAAeC,EAAsBD,EAAa,EAAE;OACpD,WAAU;OAET,UAAA3B,EAAG,yBAAyB,SAAS;MAChC,CAAA;KACL,CAAA,CAEJ;IAlBK,GAAA2B,EAAa,EAkBlB,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACE,GAAD;MACE,cAAcvB,IAAmB,iBAAiB;MAClD,OACEA,IACIN,EAAG,sCAAsC,wBAAwB,IACjEA,EAAG,mCAAmC,gBAAgB;MAE5D,aACEM,IACIN,EAAG,yCAAyC,4BAA4B,IACxEA,EACE,yCACA,oFACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;GAEL,kBAAC8B,GAAD;IACW;IACM;IACf,YAAYC;IACZ,YAAYf,EAAc;GAC3B,CAAA;EACE;;AAET"}
1
+ {"version":3,"file":"NotificationHistoryPage.js","names":["HISTORY_FILTER","NotificationHistoryPage","useNotification","jsx","navigationV2","NotificationArchivedV2","ClassicNotificationHistoryPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotifications","hasActiveFilters","notificationFilter","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","History","EmphasisPanel","Button","exportNotificationsAsCsv","notifications","Download","GlassCard","Search","updateFilter","ThemedSelect","event","topics","topic","NotificationCard","archiveNotification","recordAction","notification","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Download, History, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { NotificationArchivedV2 } from '../navigation-v2/NotificationArchivedV2';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/**\n * User Notification History — personal history, filter, CSV export,\n * archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the\n * \"Archived\" view instead; every other app keeps this page.\n */\nexport function NotificationHistoryPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationArchivedV2 /> : <ClassicNotificationHistoryPage />;\n}\n\nfunction ClassicNotificationHistoryPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n\n const hasActiveFilters = Boolean(\n notificationFilter.search ||\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<History size={16} />}>\n {tr(\n 'notifications.historyPurpose',\n 'A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.'\n )}\n </PagePurpose>\n\n {/* Single emphasis zone — the header summary + the one export CTA. */}\n <EmphasisPanel\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.historyTitle', 'Notification History')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('notifications.historySubtitle', 'View and search all your notifications')}\n </p>\n </div>\n\n <Button\n data-tour=\"notification-history-export\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </EmphasisPanel>\n\n <GlassCard\n treatment=\"plain\"\n className=\"grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5\"\n >\n <div className=\"relative sm:col-span-2 xl:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n <ThemedSelect\n value={notificationFilter.topicId || ''}\n onChange={(event) => updateFilter({ topicId: event.target.value || undefined })}\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </ThemedSelect>\n\n <input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={\n notificationFilter.dateRange.start\n ? notificationFilter.dateRange.start.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n\n <input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={\n notificationFilter.dateRange.end\n ? notificationFilter.dateRange.end.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n </GlassCard>\n\n <div className=\"space-y-2\">\n {notifications.length > 0 ? (\n notifications.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <button\n onClick={() => unarchiveNotification(notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount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