@burdenoff/microfe-notification 2026.1123.1 → 2026.1125.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.
- package/dist/AdminNotificationRoutes.js +59 -51
- package/dist/AdminNotificationRoutes.js.map +1 -1
- package/dist/NotificationRoutes.js +76 -68
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/UserNotificationRoutes.js +39 -31
- package/dist/UserNotificationRoutes.js.map +1 -1
- package/dist/components/NotificationListFooter.js +1 -1
- package/dist/components/NotificationListFooter.js.map +1 -1
- package/dist/components/loadingSystem.d.ts +64 -0
- package/dist/components/loadingSystem.js +34 -0
- package/dist/components/loadingSystem.js.map +1 -0
- package/dist/navigation-v2/AdminPageV2.js +23 -16
- package/dist/navigation-v2/AdminPageV2.js.map +1 -1
- package/dist/navigation-v2/NotificationArchivedV2.js +100 -93
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
- package/dist/navigation-v2/NotificationInboxV2.js +130 -123
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
- package/dist/navigation-v2/NotificationSettingsV2.js +91 -84
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
- package/dist/navigation-v2/NotificationsV2Landing.js +31 -23
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
- package/dist/pages/CreateNotificationPage.js +442 -432
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.js +91 -84
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.js +226 -219
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.js +69 -62
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.js +42 -34
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.js +80 -70
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +192 -181
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +124 -117
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +248 -233
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -8,17 +8,18 @@ import { NOTIFICATION_PERMISSIONS as o } from "../constants/permissions.js";
|
|
|
8
8
|
import { useNotification as s } from "../providers/NotificationProvider.js";
|
|
9
9
|
import { useTr as c } from "../shared/hooks/useTr.js";
|
|
10
10
|
import { NotificationInboxV2 as l } from "../navigation-v2/NotificationInboxV2.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
11
|
+
import { CompactMarkOr as u, SectionLoaderOr as d } from "../components/loadingSystem.js";
|
|
12
|
+
import { useMemo as f } from "react";
|
|
13
|
+
import { usePermissions as p } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
14
|
+
import { BellRing as m, CheckCheck as h, Search as g } from "lucide-react";
|
|
15
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
16
|
+
import { PushOptInToggle as b } from "@burdenoff/fe-libs/chrome";
|
|
17
|
+
import { AuroraBackground as x, Button as S, EmphasisPanel as C, GlassCard as w, GradientText as T, IllustratedEmptyState as E, PagePurpose as D, ThemedSelect as O } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
// src/pages/NotificationCenterPage.tsx
|
|
18
|
-
var
|
|
19
|
+
var k = {
|
|
19
20
|
archived: !1,
|
|
20
21
|
channel: "IN_APP"
|
|
21
|
-
},
|
|
22
|
+
}, A = { channel: "IN_APP" }, j = [
|
|
22
23
|
{
|
|
23
24
|
value: "SYSTEM",
|
|
24
25
|
labelKey: "notifications.typeSystem",
|
|
@@ -39,7 +40,7 @@ var D = {
|
|
|
39
40
|
labelKey: "notifications.typeMarketing",
|
|
40
41
|
label: "Marketing"
|
|
41
42
|
}
|
|
42
|
-
],
|
|
43
|
+
], M = [
|
|
43
44
|
{
|
|
44
45
|
value: "URGENT",
|
|
45
46
|
labelKey: "notifications.priorityUrgent",
|
|
@@ -61,177 +62,183 @@ var D = {
|
|
|
61
62
|
label: "Low"
|
|
62
63
|
}
|
|
63
64
|
];
|
|
64
|
-
function
|
|
65
|
+
function N() {
|
|
65
66
|
let { navigationV2: e } = s();
|
|
66
|
-
return
|
|
67
|
+
return v(e ? l : P, {});
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
-
let l = c(), { hasPermission:
|
|
70
|
-
baseFilter:
|
|
71
|
-
unreadFilter:
|
|
72
|
-
}), { topics:
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
function P() {
|
|
70
|
+
let l = c(), { hasPermission: N, isLoading: P } = p(), { currentUser: F } = s(), { notifications: I, hasMore: L, isLoadingMore: R, loadMore: z, unreadCount: B, notificationFilter: V, markAsRead: H, markAllAsRead: U, archiveNotification: W, recordAction: G, updateFilter: K, resetFilter: q } = e({
|
|
71
|
+
baseFilter: k,
|
|
72
|
+
unreadFilter: A
|
|
73
|
+
}), { topics: J } = n({ isActive: !0 }), Y = f(() => i(I, V), [I, V]), X = f(() => a(Y, l), [Y, l]);
|
|
74
|
+
return P ? /* @__PURE__ */ v(d, {
|
|
75
|
+
minHeight: "16rem",
|
|
76
|
+
today: /* @__PURE__ */ v("div", {
|
|
77
|
+
className: "flex h-64 items-center justify-center",
|
|
78
|
+
children: /* @__PURE__ */ v(u, {
|
|
79
|
+
className: "h-8 w-8",
|
|
80
|
+
today: /* @__PURE__ */ v("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
}) : !N(o.NOTIFICATION_LIST) && !F?.id ? /* @__PURE__ */ v("div", {
|
|
77
84
|
className: "p-8 text-center text-text-secondary",
|
|
78
85
|
children: l("notifications.noPermissionView", "You don't have permission to view notifications.")
|
|
79
|
-
}) : /* @__PURE__ */
|
|
86
|
+
}) : /* @__PURE__ */ y("div", {
|
|
80
87
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
|
|
81
88
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
icon: /* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ v(D, {
|
|
90
|
+
icon: /* @__PURE__ */ v(m, { size: 16 }),
|
|
84
91
|
children: l("notifications.centerPurpose", "Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.")
|
|
85
92
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ y("div", {
|
|
87
94
|
className: "relative overflow-hidden rounded-2xl",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ v(x, { intensity: "subtle" }), /* @__PURE__ */ y(C, {
|
|
89
96
|
"data-tour": "notification-center-header",
|
|
90
97
|
className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
92
99
|
className: "text-xl sm:text-2xl font-bold text-primary",
|
|
93
|
-
children: /* @__PURE__ */
|
|
94
|
-
}), /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ v(T, { children: l("notifications.centerTitle", "Notification Center") })
|
|
101
|
+
}), /* @__PURE__ */ v("p", {
|
|
95
102
|
className: "text-sm text-text-secondary mt-1",
|
|
96
|
-
children:
|
|
103
|
+
children: B > 0 ? /* @__PURE__ */ y(_, { children: [
|
|
97
104
|
l("notifications.youHave", "You have"),
|
|
98
105
|
" ",
|
|
99
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ y("span", {
|
|
100
107
|
className: "inline-flex items-center gap-1.5 font-semibold text-primary",
|
|
101
108
|
"data-tour": "notification-center-unread-count",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ v("span", { className: "inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse" }), B]
|
|
103
110
|
}),
|
|
104
111
|
" ",
|
|
105
|
-
l(
|
|
112
|
+
l(B === 1 ? "notifications.unreadNotification" : "notifications.unreadNotifications", B === 1 ? "unread notification" : "unread notifications")
|
|
106
113
|
] }) : l("notifications.allCaughtUp", "All caught up!")
|
|
107
|
-
})] }),
|
|
114
|
+
})] }), B > 0 && /* @__PURE__ */ y(S, {
|
|
108
115
|
"data-tour": "notification-center-mark-all-read",
|
|
109
116
|
variant: "outline",
|
|
110
|
-
onClick:
|
|
117
|
+
onClick: U,
|
|
111
118
|
className: "gap-2",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ v(h, { size: 16 }), l("notifications.markAllAsRead", "Mark All as Read")]
|
|
113
120
|
})]
|
|
114
121
|
})]
|
|
115
122
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ v(b, {}),
|
|
124
|
+
/* @__PURE__ */ y(w, {
|
|
118
125
|
treatment: "plain",
|
|
119
126
|
"data-tour": "notification-center-filters",
|
|
120
127
|
className: "flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4",
|
|
121
128
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ y("div", {
|
|
123
130
|
className: "relative flex-1",
|
|
124
|
-
children: [/* @__PURE__ */ g
|
|
131
|
+
children: [/* @__PURE__ */ v(g, {
|
|
125
132
|
size: 16,
|
|
126
133
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
|
|
127
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ v("input", {
|
|
128
135
|
"data-tour": "notification-center-search",
|
|
129
136
|
type: "text",
|
|
130
137
|
placeholder: l("notifications.searchPlaceholder", "Search notifications..."),
|
|
131
|
-
value:
|
|
132
|
-
onChange: (e) =>
|
|
138
|
+
value: V.search,
|
|
139
|
+
onChange: (e) => K({ search: e.target.value }),
|
|
133
140
|
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"
|
|
134
141
|
})]
|
|
135
142
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
value:
|
|
138
|
-
onChange: (e) =>
|
|
143
|
+
/* @__PURE__ */ y(O, {
|
|
144
|
+
value: V.type,
|
|
145
|
+
onChange: (e) => K({ type: e.target.value }),
|
|
139
146
|
className: "px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ v("option", {
|
|
141
148
|
value: "ALL",
|
|
142
149
|
children: l("notifications.allTypes", "All Types")
|
|
143
|
-
}),
|
|
150
|
+
}), j.map((e) => /* @__PURE__ */ v("option", {
|
|
144
151
|
value: e.value,
|
|
145
152
|
children: l(e.labelKey, e.label)
|
|
146
153
|
}, e.value))]
|
|
147
154
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
value:
|
|
150
|
-
onChange: (e) =>
|
|
155
|
+
/* @__PURE__ */ y(O, {
|
|
156
|
+
value: V.priority,
|
|
157
|
+
onChange: (e) => K({ priority: e.target.value }),
|
|
151
158
|
className: "px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ v("option", {
|
|
153
160
|
value: "ALL",
|
|
154
161
|
children: l("notifications.allPriorities", "All Priorities")
|
|
155
|
-
}),
|
|
162
|
+
}), M.map((e) => /* @__PURE__ */ v("option", {
|
|
156
163
|
value: e.value,
|
|
157
164
|
children: l(e.labelKey, e.label)
|
|
158
165
|
}, e.value))]
|
|
159
166
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
value:
|
|
162
|
-
onChange: (e) =>
|
|
167
|
+
/* @__PURE__ */ y(O, {
|
|
168
|
+
value: V.topicId || "",
|
|
169
|
+
onChange: (e) => K({ topicId: e.target.value || void 0 }),
|
|
163
170
|
className: "px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ v("option", {
|
|
165
172
|
value: "",
|
|
166
173
|
children: l("notifications.allTopics", "All Topics")
|
|
167
|
-
}),
|
|
174
|
+
}), J.map((e) => /* @__PURE__ */ v("option", {
|
|
168
175
|
value: e.id,
|
|
169
176
|
children: e.name
|
|
170
177
|
}, e.id))]
|
|
171
178
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
value:
|
|
174
|
-
onChange: (e) =>
|
|
179
|
+
/* @__PURE__ */ y(O, {
|
|
180
|
+
value: V.isRead === null ? "ALL" : V.isRead ? "READ" : "UNREAD",
|
|
181
|
+
onChange: (e) => K({ isRead: e.target.value === "ALL" ? null : e.target.value === "READ" }),
|
|
175
182
|
className: "px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
176
183
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ v("option", {
|
|
178
185
|
value: "ALL",
|
|
179
186
|
children: l("notifications.filterAll", "All")
|
|
180
187
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ v("option", {
|
|
182
189
|
value: "UNREAD",
|
|
183
190
|
children: l("notifications.filterUnread", "Unread")
|
|
184
191
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ v("option", {
|
|
186
193
|
value: "READ",
|
|
187
194
|
children: l("notifications.filterRead", "Read")
|
|
188
195
|
})
|
|
189
196
|
]
|
|
190
197
|
}),
|
|
191
|
-
(
|
|
192
|
-
onClick:
|
|
198
|
+
(V.search || V.type !== "ALL" || V.priority !== "ALL" || V.isRead !== null || !!V.topicId) && /* @__PURE__ */ v("button", {
|
|
199
|
+
onClick: q,
|
|
193
200
|
className: "px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150",
|
|
194
201
|
children: l("notifications.resetFilters", "Reset")
|
|
195
202
|
})
|
|
196
203
|
]
|
|
197
204
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ v("div", {
|
|
199
206
|
"data-tour": "notification-center-list",
|
|
200
207
|
className: "space-y-6",
|
|
201
|
-
children:
|
|
208
|
+
children: Y.length > 0 ? Object.entries(X).map(([e, n]) => /* @__PURE__ */ y("div", {
|
|
202
209
|
className: "animate-in fade-in slide-in-from-bottom-2 duration-200",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ v("h2", {
|
|
204
211
|
className: "text-sm font-semibold text-tertiary mb-3",
|
|
205
212
|
children: e
|
|
206
|
-
}), /* @__PURE__ */
|
|
213
|
+
}), /* @__PURE__ */ v("div", {
|
|
207
214
|
className: "space-y-2",
|
|
208
|
-
children: n.map((e) => /* @__PURE__ */
|
|
215
|
+
children: n.map((e) => /* @__PURE__ */ v(t, {
|
|
209
216
|
notification: e,
|
|
210
|
-
onMarkAsRead:
|
|
211
|
-
onArchive:
|
|
212
|
-
onAction:
|
|
217
|
+
onMarkAsRead: H,
|
|
218
|
+
onArchive: W,
|
|
219
|
+
onAction: G,
|
|
213
220
|
analyticsSource: "center"
|
|
214
221
|
}, e.id))
|
|
215
222
|
})]
|
|
216
|
-
}, e)) : /* @__PURE__ */
|
|
223
|
+
}, e)) : /* @__PURE__ */ v("div", {
|
|
217
224
|
className: "animate-in fade-in duration-200",
|
|
218
|
-
children: /* @__PURE__ */
|
|
219
|
-
illustration:
|
|
225
|
+
children: /* @__PURE__ */ v(E, {
|
|
226
|
+
illustration: I.length === 0 ? "empty-notifications" : "empty-search",
|
|
220
227
|
title: l("notifications.noNotificationsFound", "No notifications found"),
|
|
221
|
-
description:
|
|
222
|
-
kind:
|
|
228
|
+
description: I.length === 0 ? l("notifications.noNotificationsYet", "You don't have any notifications yet. We'll notify you when something important happens.") : l("notifications.adjustFilters", "Try adjusting your filters to see more notifications."),
|
|
229
|
+
kind: V.search ? "no-results" : V.type !== "ALL" || V.priority !== "ALL" || V.isRead !== null || V.topicId ? "filtered" : "first-use"
|
|
223
230
|
})
|
|
224
231
|
})
|
|
225
232
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
hasMore:
|
|
228
|
-
isLoadingMore:
|
|
229
|
-
onLoadMore:
|
|
230
|
-
shownCount:
|
|
233
|
+
/* @__PURE__ */ v(r, {
|
|
234
|
+
hasMore: L,
|
|
235
|
+
isLoadingMore: R,
|
|
236
|
+
onLoadMore: z,
|
|
237
|
+
shownCount: Y.length
|
|
231
238
|
})
|
|
232
239
|
]
|
|
233
240
|
});
|
|
234
241
|
}
|
|
235
|
-
export {
|
|
242
|
+
export { N as NotificationCenterPage };
|
|
236
243
|
|
|
237
244
|
//# sourceMappingURL=NotificationCenterPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","ThemedSelect","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications, tr),\n [filteredNotifications, tr]\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('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\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={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-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 <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\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 {/* Type filter */}\n <ThemedSelect\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n\n {/* Priority filter */}\n <ThemedSelect\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n\n <ThemedSelect\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 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 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 {/* Read/Unread filter */}\n <ThemedSelect\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </ThemedSelect>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </GlassCard>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-200\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\n notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n // The server applies the search and the filters, so the kind follows them, not the\n // length of what came back.\n kind={\n notificationFilter.search\n ? 'no-results'\n : notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n notificationFilter.topicId\n ? 'filtered'\n : 'first-use'\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={filteredNotifications.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAMC,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAQ;CACtE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CA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A,EAAmB,WAAW,QAC9BA,EAAmB,UACnB,aACA;KAET,CAAA;IACE,CAAA;GAEJ,CAAA;GAEL,kBAACiC,GAAD;IACW;IACM;IACf,YAAYC;IACZ,YAAYtC,EAAsB;GACnC,CAAA;EACE;;AAET"}
|
|
1
|
+
{"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","ThemedSelect","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications, tr),\n [filteredNotifications, tr]\n );\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\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('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\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={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-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 <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\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 {/* Type filter */}\n <ThemedSelect\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n\n {/* Priority filter */}\n <ThemedSelect\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n\n <ThemedSelect\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 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 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 {/* Read/Unread filter */}\n <ThemedSelect\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </ThemedSelect>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </GlassCard>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-200\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\n notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n // The server applies the search and the filters, so the kind follows them, not the\n // length of what came back.\n kind={\n notificationFilter.search\n ? 'no-results'\n : notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n notificationFilter.topicId\n ? 'filtered'\n : 'first-use'\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n is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