@burdenoff/microfe-notification 2026.1117.2 → 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.
- package/dist/components/NotificationListFooter.d.ts +18 -0
- package/dist/components/NotificationListFooter.js +43 -0
- package/dist/components/NotificationListFooter.js.map +1 -0
- package/dist/hooks/notificationPaging.d.ts +51 -0
- package/dist/hooks/notificationPaging.js +43 -0
- package/dist/hooks/notificationPaging.js.map +1 -0
- package/dist/hooks/useNotifications.d.ts +2 -0
- package/dist/hooks/useNotifications.js +177 -129
- package/dist/hooks/useNotifications.js.map +1 -1
- package/dist/navigation-v2/NotificationArchivedV2.js +98 -91
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
- package/dist/navigation-v2/NotificationInboxV2.js +78 -71
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
- package/dist/pages/CreateNotificationPage.js +108 -108
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.js +105 -98
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.js +122 -122
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.js +77 -70
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +140 -140
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +74 -74
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +361 -361
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/translations/en.d.ts +3 -0
- package/package.json +2 -2
|
@@ -4,12 +4,12 @@ import { useTr as n } from "../shared/hooks/useTr.js";
|
|
|
4
4
|
import { nativeConfirm as r, nativeImpact as i, nativeNotify as a } from "../utils/nativeBridge.js";
|
|
5
5
|
import { ConfirmDeleteDialog as o } from "../components/ConfirmDeleteDialog.js";
|
|
6
6
|
import { useNavigationV2 as s, useNotificationPaths as c } from "../navigation-v2/paths.js";
|
|
7
|
-
import { useMemo as
|
|
8
|
-
import { usePermissions as
|
|
9
|
-
import { AlertCircle as
|
|
10
|
-
import { useNavigate as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { Button as
|
|
7
|
+
import { useMemo as l, useState as u } from "react";
|
|
8
|
+
import { usePermissions as d } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
|
+
import { AlertCircle as f, FileText as p, Loader2 as m, Plus as h, RefreshCw as ee, Search as te, Trash2 as g } from "lucide-react";
|
|
10
|
+
import { useNavigate as _ } from "react-router";
|
|
11
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
|
+
import { Button as b, EmphasisPanel as ne, GlassCard as re, IllustratedEmptyState as ie, NextSteps as ae, PagePurpose as oe, ThemedSelect as se } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
14
|
// src/pages/NotificationTemplatesPage.tsx
|
|
15
15
|
var S = {
|
|
@@ -17,59 +17,59 @@ var S = {
|
|
|
17
17
|
MARKETING: "text-accent-purple bg-accent-purple-subtle border-accent-purple-subtle",
|
|
18
18
|
SYSTEM: "text-status-warning-text bg-status-warning-bg-subtle border-status-warning-bg-subtle",
|
|
19
19
|
ALERT: "text-status-error-text bg-status-error-bg-subtle border-status-error-bg-subtle"
|
|
20
|
-
},
|
|
20
|
+
}, C = {
|
|
21
21
|
TRANSACTIONAL: "Transactional",
|
|
22
22
|
MARKETING: "Marketing",
|
|
23
23
|
SYSTEM: "System",
|
|
24
24
|
ALERT: "Alert"
|
|
25
25
|
};
|
|
26
|
-
function
|
|
26
|
+
function w(e, t) {
|
|
27
27
|
return new Date(e).toLocaleDateString(t || "en-US", {
|
|
28
28
|
month: "short",
|
|
29
29
|
day: "numeric",
|
|
30
30
|
year: "numeric"
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
let
|
|
33
|
+
function T() {
|
|
34
|
+
let T = _(), E = n(), D = c(), O = s(), [k, A] = u(null), j = (e, t) => O ? new Promise((n) => A({
|
|
35
35
|
title: e,
|
|
36
36
|
message: t,
|
|
37
37
|
resolve: n
|
|
38
|
-
})) : Promise.resolve(window.confirm(t)), { locale:
|
|
38
|
+
})) : Promise.resolve(window.confirm(t)), { locale: ce } = x(), { hasPermission: M, isLoading: le } = d(), { templates: N, isLoading: P, isDeleting: F, error: I, total: L, hasMore: R, filter: z, refetch: B, loadMore: V, deleteTemplate: H, updateFilter: U } = e(), [W, G] = u(null), [K, q] = u(null), [J, Y] = u(/* @__PURE__ */ new Set()), X = l(() => N.filter((e) => J.has(e.id)), [J, N]), Z = N.length > 0 && N.every((e) => J.has(e.id)), ue = N.some((e) => J.has(e.id)) && !Z, Q = M(t.TEMPLATE_CREATE), $ = M(t.TEMPLATE_DELETE), de = async (e, t) => {
|
|
39
39
|
e.stopPropagation(), i("medium");
|
|
40
|
-
let n =
|
|
41
|
-
title:
|
|
40
|
+
let n = E("notifTemplates.confirmDelete", `Delete template "${t.name}"? This cannot be undone.`), o = await r({
|
|
41
|
+
title: E("notifTemplates.deleteTitle", "Delete template"),
|
|
42
42
|
message: n,
|
|
43
|
-
okButtonTitle:
|
|
43
|
+
okButtonTitle: E("notifTemplates.delete", "Delete")
|
|
44
44
|
});
|
|
45
|
-
if (o === null ? await
|
|
45
|
+
if (o === null ? await j(E("notifTemplates.deleteTitle", "Delete template"), n) : o) {
|
|
46
46
|
G(t.id), q(null);
|
|
47
47
|
try {
|
|
48
48
|
await H(t.id), a("success");
|
|
49
49
|
} catch (e) {
|
|
50
|
-
a("error"), q(e instanceof Error ? e.message :
|
|
50
|
+
a("error"), q(e instanceof Error ? e.message : E("notifTemplates.deleteFailed", "Failed to delete template"));
|
|
51
51
|
} finally {
|
|
52
52
|
G(null);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
},
|
|
55
|
+
}, fe = async () => {
|
|
56
56
|
if (X.length === 0) return;
|
|
57
57
|
i("medium");
|
|
58
|
-
let e =
|
|
59
|
-
title:
|
|
58
|
+
let e = E("notifTemplates.confirmBulkDelete", `Delete ${X.length} selected template${X.length === 1 ? "" : "s"}? This cannot be undone.`), t = await r({
|
|
59
|
+
title: E("notifTemplates.bulkDeleteTitle", "Delete templates"),
|
|
60
60
|
message: e,
|
|
61
|
-
okButtonTitle:
|
|
61
|
+
okButtonTitle: E("notifTemplates.delete", "Delete")
|
|
62
62
|
});
|
|
63
|
-
if (!(t === null ? await
|
|
63
|
+
if (!(t === null ? await j(E("notifTemplates.bulkDeleteTitle", "Delete templates"), e) : t)) return;
|
|
64
64
|
q(null);
|
|
65
65
|
let n = (await Promise.allSettled(X.map((e) => H(e.id)))).some((e) => e.status === "rejected");
|
|
66
66
|
a(n ? "error" : "success"), Y(/* @__PURE__ */ new Set());
|
|
67
|
-
},
|
|
67
|
+
}, pe = (e, t) => {
|
|
68
68
|
Y((n) => {
|
|
69
69
|
let r = new Set(n);
|
|
70
70
|
return t ? r.add(e) : r.delete(e), r;
|
|
71
71
|
});
|
|
72
|
-
},
|
|
72
|
+
}, me = (e) => {
|
|
73
73
|
Y((t) => {
|
|
74
74
|
let n = new Set(t);
|
|
75
75
|
return N.forEach((t) => {
|
|
@@ -77,297 +77,297 @@ function w() {
|
|
|
77
77
|
}), n;
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
|
-
return
|
|
80
|
+
return le ? /* @__PURE__ */ v("div", {
|
|
81
81
|
className: "flex h-64 items-center justify-center",
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
-
}) : M(t.TEMPLATE_LIST) || Q || $ || M(t.TEMPLATE_UPDATE) ? P && N.length === 0 ? /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ v("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
83
|
+
}) : M(t.TEMPLATE_LIST) || Q || $ || M(t.TEMPLATE_UPDATE) ? P && N.length === 0 ? /* @__PURE__ */ y("div", {
|
|
84
84
|
className: "flex flex-col items-center justify-center h-64 gap-3",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ v(m, {
|
|
86
86
|
size: 28,
|
|
87
87
|
className: "animate-spin text-accent-primary"
|
|
88
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ v("p", {
|
|
89
89
|
className: "text-sm text-text-secondary",
|
|
90
|
-
children:
|
|
90
|
+
children: E("notifTemplates.loading", "Loading templates...")
|
|
91
91
|
})]
|
|
92
|
-
}) : I && N.length === 0 ? /* @__PURE__ */
|
|
92
|
+
}) : I && N.length === 0 ? /* @__PURE__ */ y("div", {
|
|
93
93
|
className: "flex flex-col items-center justify-center h-64 gap-4",
|
|
94
94
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ v(f, {
|
|
96
96
|
size: 28,
|
|
97
97
|
className: "text-error"
|
|
98
98
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ v("p", {
|
|
100
100
|
className: "text-sm text-error",
|
|
101
101
|
children: I
|
|
102
102
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ y("button", {
|
|
104
104
|
onClick: B,
|
|
105
105
|
className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-accent-primary hover:bg-accent-primary/90 rounded-lg transition-all duration-150",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ v(ee, { size: 14 }), E("notifTemplates.retry", "Retry")]
|
|
107
107
|
})
|
|
108
108
|
]
|
|
109
|
-
}) : /* @__PURE__ */
|
|
109
|
+
}) : /* @__PURE__ */ y("div", {
|
|
110
110
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
|
|
111
111
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
icon: /* @__PURE__ */
|
|
114
|
-
children:
|
|
112
|
+
/* @__PURE__ */ v(oe, {
|
|
113
|
+
icon: /* @__PURE__ */ v(p, { size: 16 }),
|
|
114
|
+
children: E("notifTemplates.purpose", "Reusable, versioned message blueprints — subject lines, bodies and channel layouts with {{variables}} you fill in at send time. Build a template once (e.g. a welcome email or a payment receipt) and reuse it from the Send page so every notification stays on-brand and consistent.")
|
|
115
115
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ y(ne, {
|
|
117
117
|
className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
119
119
|
className: "text-xl sm:text-2xl font-bold text-primary",
|
|
120
|
-
children:
|
|
121
|
-
}), /* @__PURE__ */
|
|
120
|
+
children: E("notifTemplates.title", "Notification Templates")
|
|
121
|
+
}), /* @__PURE__ */ y("p", {
|
|
122
122
|
className: "text-sm text-text-secondary mt-1",
|
|
123
123
|
children: [
|
|
124
124
|
L,
|
|
125
125
|
" ",
|
|
126
|
-
|
|
126
|
+
E("notifTemplates.templateCount", "template"),
|
|
127
127
|
L === 1 ? "" : "s",
|
|
128
128
|
" ",
|
|
129
|
-
|
|
129
|
+
E("notifTemplates.total", "total")
|
|
130
130
|
]
|
|
131
|
-
})] }), Q && /* @__PURE__ */
|
|
132
|
-
onClick: () =>
|
|
131
|
+
})] }), Q && /* @__PURE__ */ y(b, {
|
|
132
|
+
onClick: () => T(D.newTemplate),
|
|
133
133
|
className: "gap-2",
|
|
134
|
-
children: [/* @__PURE__ */ h
|
|
134
|
+
children: [/* @__PURE__ */ v(h, { size: 16 }), E("notifTemplates.createTemplate", "Create Template")]
|
|
135
135
|
})]
|
|
136
136
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ v(ae, {
|
|
138
138
|
storageKey: "notification-templates",
|
|
139
139
|
steps: [
|
|
140
140
|
...Q ? [{
|
|
141
141
|
id: "create-template",
|
|
142
|
-
label:
|
|
143
|
-
description:
|
|
144
|
-
onClick: () =>
|
|
142
|
+
label: E("notifTemplates.nextCreateLabel", "Create your first template"),
|
|
143
|
+
description: E("notifTemplates.nextCreateDesc", "Build a reusable message blueprint with {{variables}} you fill in at send time."),
|
|
144
|
+
onClick: () => T(D.newTemplate)
|
|
145
145
|
}] : [],
|
|
146
146
|
{
|
|
147
147
|
id: "filter-type",
|
|
148
|
-
label:
|
|
149
|
-
description:
|
|
148
|
+
label: E("notifTemplates.nextFilterLabel", "Filter by type"),
|
|
149
|
+
description: E("notifTemplates.nextFilterDesc", "Narrow to Transactional, Marketing, System or Alert templates to find one fast."),
|
|
150
150
|
onClick: () => U({ type: "TRANSACTIONAL" })
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
id: "use-on-send",
|
|
154
|
-
label:
|
|
155
|
-
description:
|
|
156
|
-
href:
|
|
154
|
+
label: E("notifTemplates.nextUseLabel", "Send with a template"),
|
|
155
|
+
description: E("notifTemplates.nextUseDesc", "Pick any saved template from the Send page so every notification stays on-brand."),
|
|
156
|
+
href: D.send
|
|
157
157
|
}
|
|
158
158
|
]
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ y("div", {
|
|
161
161
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ y("div", {
|
|
163
163
|
className: "relative flex-1",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ v(te, {
|
|
165
165
|
size: 16,
|
|
166
166
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
|
|
167
|
-
}), /* @__PURE__ */
|
|
167
|
+
}), /* @__PURE__ */ v("input", {
|
|
168
168
|
type: "text",
|
|
169
169
|
value: z.search || "",
|
|
170
170
|
onChange: (e) => U({ search: e.target.value }),
|
|
171
|
-
placeholder:
|
|
171
|
+
placeholder: E("notifTemplates.searchPlaceholder", "Search templates..."),
|
|
172
172
|
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"
|
|
173
173
|
})]
|
|
174
|
-
}), /* @__PURE__ */
|
|
174
|
+
}), /* @__PURE__ */ y(se, {
|
|
175
175
|
value: z.type || "",
|
|
176
176
|
onChange: (e) => U({ type: e.target.value || void 0 }),
|
|
177
177
|
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",
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ v("option", {
|
|
180
180
|
value: "",
|
|
181
|
-
children:
|
|
181
|
+
children: E("notifTemplates.allTypes", "All Types")
|
|
182
182
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ v("option", {
|
|
184
184
|
value: "TRANSACTIONAL",
|
|
185
|
-
children:
|
|
185
|
+
children: E("notifTemplates.typeTransactional", "Transactional")
|
|
186
186
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ v("option", {
|
|
188
188
|
value: "MARKETING",
|
|
189
|
-
children:
|
|
189
|
+
children: E("notifTemplates.typeMarketing", "Marketing")
|
|
190
190
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ v("option", {
|
|
192
192
|
value: "SYSTEM",
|
|
193
|
-
children:
|
|
193
|
+
children: E("notifTemplates.typeSystem", "System")
|
|
194
194
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ v("option", {
|
|
196
196
|
value: "ALERT",
|
|
197
|
-
children:
|
|
197
|
+
children: E("notifTemplates.typeAlert", "Alert")
|
|
198
198
|
})
|
|
199
199
|
]
|
|
200
200
|
})]
|
|
201
201
|
}),
|
|
202
|
-
N.length > 0 && /* @__PURE__ */
|
|
202
|
+
N.length > 0 && /* @__PURE__ */ y(re, {
|
|
203
203
|
treatment: "plain",
|
|
204
204
|
className: "flex flex-col gap-3 border-border-seam p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ y("label", {
|
|
206
206
|
className: "flex items-center gap-2 text-sm text-primary",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ v("input", {
|
|
208
208
|
type: "checkbox",
|
|
209
209
|
checked: Z,
|
|
210
210
|
ref: (e) => {
|
|
211
|
-
e && (e.indeterminate =
|
|
211
|
+
e && (e.indeterminate = ue && !Z);
|
|
212
212
|
},
|
|
213
|
-
onChange: (e) =>
|
|
214
|
-
"aria-label":
|
|
213
|
+
onChange: (e) => me(e.target.checked),
|
|
214
|
+
"aria-label": E("notifTemplates.selectAllVisibleAria", "Select all notification templates"),
|
|
215
215
|
className: "h-4 w-4 rounded border-default text-accent-primary"
|
|
216
|
-
}), /* @__PURE__ */
|
|
217
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ v("span", { children: E("notifTemplates.selectAllVisible", "Select all visible") })]
|
|
217
|
+
}), /* @__PURE__ */ y("div", {
|
|
218
218
|
className: "flex items-center gap-2",
|
|
219
219
|
children: [
|
|
220
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ y("span", {
|
|
221
221
|
className: "text-sm text-text-secondary",
|
|
222
222
|
children: [
|
|
223
223
|
J.size,
|
|
224
224
|
" ",
|
|
225
|
-
|
|
225
|
+
E("notifTemplates.selected", "selected")
|
|
226
226
|
]
|
|
227
227
|
}),
|
|
228
|
-
J.size > 0 && /* @__PURE__ */
|
|
228
|
+
J.size > 0 && /* @__PURE__ */ v("button", {
|
|
229
229
|
onClick: () => Y(/* @__PURE__ */ new Set()),
|
|
230
230
|
className: "text-sm text-text-secondary hover:text-primary",
|
|
231
|
-
children:
|
|
231
|
+
children: E("notifTemplates.clearSelection", "Clear selection")
|
|
232
232
|
}),
|
|
233
|
-
$ && /* @__PURE__ */
|
|
234
|
-
onClick:
|
|
233
|
+
$ && /* @__PURE__ */ y("button", {
|
|
234
|
+
onClick: fe,
|
|
235
235
|
disabled: X.length === 0 || F,
|
|
236
236
|
className: "flex items-center gap-2 px-3 py-2 text-sm font-medium text-error border border-error/30 hover:bg-error/10 rounded-lg transition-all duration-150 disabled:opacity-50",
|
|
237
237
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
|
|
238
|
+
/* @__PURE__ */ v(g, { size: 14 }),
|
|
239
|
+
E("notifTemplates.deleteSelected", "Delete Selected"),
|
|
240
240
|
X.length > 0 ? ` (${X.length})` : ""
|
|
241
241
|
]
|
|
242
242
|
})
|
|
243
243
|
]
|
|
244
244
|
})]
|
|
245
245
|
}),
|
|
246
|
-
K && /* @__PURE__ */
|
|
246
|
+
K && /* @__PURE__ */ y("div", {
|
|
247
247
|
className: "flex items-center gap-3 p-3 bg-error/10 border border-error/30 rounded-lg",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ v(f, {
|
|
249
249
|
size: 16,
|
|
250
250
|
className: "text-error shrink-0"
|
|
251
|
-
}), /* @__PURE__ */
|
|
251
|
+
}), /* @__PURE__ */ v("p", {
|
|
252
252
|
className: "text-sm text-error",
|
|
253
253
|
children: K
|
|
254
254
|
})]
|
|
255
255
|
}),
|
|
256
|
-
N.length === 0 && !P && /* @__PURE__ */
|
|
256
|
+
N.length === 0 && !P && /* @__PURE__ */ v(ie, {
|
|
257
257
|
illustration: z.search || z.type ? "empty-search" : "empty-files",
|
|
258
|
-
title: z.search || z.type ?
|
|
259
|
-
description: z.search || z.type ?
|
|
260
|
-
action: !z.search && !z.type && Q ? /* @__PURE__ */
|
|
261
|
-
onClick: () =>
|
|
258
|
+
title: z.search || z.type ? E("notifTemplates.noMatchingTemplates", "No templates match your filters") : E("notifTemplates.noTemplatesYet", "No templates yet. Create your first one!"),
|
|
259
|
+
description: z.search || z.type ? E("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : E("notifTemplates.noTemplatesDescription", "Reusable templates let you send consistent notifications fast."),
|
|
260
|
+
action: !z.search && !z.type && Q ? /* @__PURE__ */ y(b, {
|
|
261
|
+
onClick: () => T(D.newTemplate),
|
|
262
262
|
className: "gap-2",
|
|
263
|
-
children: [/* @__PURE__ */ h
|
|
263
|
+
children: [/* @__PURE__ */ v(h, { size: 16 }), E("notifTemplates.createTemplate", "Create Template")]
|
|
264
264
|
}) : void 0
|
|
265
265
|
}),
|
|
266
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ v("div", {
|
|
267
267
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
268
|
-
children: N.map((e) => /* @__PURE__ */
|
|
269
|
-
onClick: () =>
|
|
268
|
+
children: N.map((e) => /* @__PURE__ */ y("div", {
|
|
269
|
+
onClick: () => T(D.template(e.slug)),
|
|
270
270
|
className: `group relative p-4 bg-gloss-card border rounded-lg cursor-pointer transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 ${J.has(e.id) ? "border-accent-primary/50 ring-1 ring-accent-primary/20" : "border-border-seam"}`,
|
|
271
271
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ y("div", {
|
|
273
273
|
className: "flex items-start justify-between mb-3",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ y("div", {
|
|
275
275
|
className: "flex items-center gap-2",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ v("input", {
|
|
277
277
|
type: "checkbox",
|
|
278
278
|
checked: J.has(e.id),
|
|
279
279
|
onChange: (t) => {
|
|
280
|
-
t.stopPropagation(),
|
|
280
|
+
t.stopPropagation(), pe(e.id, t.target.checked);
|
|
281
281
|
},
|
|
282
282
|
onClick: (e) => e.stopPropagation(),
|
|
283
|
-
"aria-label":
|
|
283
|
+
"aria-label": E("notifTemplates.selectTemplateAria", "Select template {{name}}").replace("{{name}}", e.name),
|
|
284
284
|
className: "h-4 w-4 rounded border-default text-accent-primary"
|
|
285
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ v(p, {
|
|
286
286
|
size: 20,
|
|
287
287
|
className: "text-accent-primary"
|
|
288
288
|
})]
|
|
289
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ y("div", {
|
|
290
290
|
className: "flex items-center gap-2",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ v("span", {
|
|
292
292
|
className: `px-2 py-0.5 text-[10px] font-semibold rounded-full border ${S[e.type] || "text-tertiary bg-bg-sunken border-default"}`,
|
|
293
|
-
children:
|
|
294
|
-
}), $ && /* @__PURE__ */
|
|
295
|
-
onClick: (t) =>
|
|
293
|
+
children: E(`notifTemplates.type.${e.type}`, C[e.type] || e.type)
|
|
294
|
+
}), $ && /* @__PURE__ */ v("button", {
|
|
295
|
+
onClick: (t) => de(t, e),
|
|
296
296
|
disabled: F && W === e.id,
|
|
297
297
|
className: "opacity-0 group-hover:opacity-100 p-1 text-tertiary hover:text-error rounded transition-all duration-150",
|
|
298
|
-
title:
|
|
299
|
-
children: F && W === e.id ? /* @__PURE__ */
|
|
298
|
+
title: E("notifTemplates.deleteTemplate", "Delete template"),
|
|
299
|
+
children: F && W === e.id ? /* @__PURE__ */ v(m, {
|
|
300
300
|
size: 14,
|
|
301
301
|
className: "animate-spin"
|
|
302
|
-
}) : /* @__PURE__ */
|
|
302
|
+
}) : /* @__PURE__ */ v(g, { size: 14 })
|
|
303
303
|
})]
|
|
304
304
|
})]
|
|
305
305
|
}),
|
|
306
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ v("h3", {
|
|
307
307
|
className: "text-sm font-semibold text-primary mb-1 truncate",
|
|
308
308
|
children: e.name
|
|
309
309
|
}),
|
|
310
|
-
e.description && /* @__PURE__ */
|
|
310
|
+
e.description && /* @__PURE__ */ v("p", {
|
|
311
311
|
className: "text-xs text-text-secondary mb-2 line-clamp-2",
|
|
312
312
|
children: e.description
|
|
313
313
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ y("div", {
|
|
315
315
|
className: "flex items-center gap-2 text-[11px] text-tertiary mt-auto pt-2 border-t border-default/50",
|
|
316
316
|
children: [
|
|
317
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ v("code", {
|
|
318
318
|
className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[10px]",
|
|
319
319
|
children: e.slug
|
|
320
320
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ v("span", { children: "•" }),
|
|
322
|
+
/* @__PURE__ */ v("span", { children: e.locale || "en" }),
|
|
323
|
+
/* @__PURE__ */ v("span", { children: "•" }),
|
|
324
|
+
/* @__PURE__ */ v("span", {
|
|
325
325
|
className: e.enabled ? "text-success" : "text-tertiary",
|
|
326
|
-
children: e.enabled ?
|
|
326
|
+
children: e.enabled ? E("notifTemplates.enabled", "Enabled") : E("notifTemplates.disabled", "Disabled")
|
|
327
327
|
})
|
|
328
328
|
]
|
|
329
329
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ y("p", {
|
|
331
331
|
className: "text-[10px] text-tertiary mt-1.5",
|
|
332
332
|
children: [
|
|
333
|
-
|
|
333
|
+
E("notifTemplates.updated", "Updated"),
|
|
334
334
|
" ",
|
|
335
|
-
|
|
335
|
+
w(e.updatedAt, ce)
|
|
336
336
|
]
|
|
337
337
|
})
|
|
338
338
|
]
|
|
339
339
|
}, e.id))
|
|
340
340
|
}),
|
|
341
|
-
R && /* @__PURE__ */
|
|
341
|
+
R && /* @__PURE__ */ v("div", {
|
|
342
342
|
className: "flex justify-center pt-2",
|
|
343
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ y("button", {
|
|
344
344
|
onClick: V,
|
|
345
345
|
disabled: P,
|
|
346
346
|
className: "flex items-center gap-2 px-4 py-2 text-sm text-text-secondary hover:text-primary border border-default rounded-lg transition-all duration-150 hover:shadow-sm",
|
|
347
|
-
children: [P ? /* @__PURE__ */
|
|
347
|
+
children: [P ? /* @__PURE__ */ v(m, {
|
|
348
348
|
size: 14,
|
|
349
349
|
className: "animate-spin"
|
|
350
|
-
}) : null,
|
|
350
|
+
}) : null, E("notifTemplates.loadMore", "Load More")]
|
|
351
351
|
})
|
|
352
352
|
}),
|
|
353
|
-
|
|
354
|
-
open:
|
|
355
|
-
title:
|
|
356
|
-
description:
|
|
357
|
-
confirmLabel:
|
|
353
|
+
O && /* @__PURE__ */ v(o, {
|
|
354
|
+
open: k !== null,
|
|
355
|
+
title: k?.title ?? "",
|
|
356
|
+
description: k?.message ?? "",
|
|
357
|
+
confirmLabel: E("notifTemplates.delete", "Delete"),
|
|
358
358
|
onCancel: () => {
|
|
359
|
-
|
|
359
|
+
k?.resolve(!1), A(null);
|
|
360
360
|
},
|
|
361
361
|
onConfirm: () => {
|
|
362
|
-
|
|
362
|
+
k?.resolve(!0), A(null);
|
|
363
363
|
}
|
|
364
364
|
})
|
|
365
365
|
]
|
|
366
|
-
}) : /* @__PURE__ */
|
|
366
|
+
}) : /* @__PURE__ */ v("div", {
|
|
367
367
|
className: "p-8 text-center text-text-secondary",
|
|
368
|
-
children:
|
|
368
|
+
children: E("notifTemplates.noPermissionView", "You don't have permission to view notification templates.")
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
|
-
export {
|
|
371
|
+
export { T as NotificationTemplatesPage };
|
|
372
372
|
|
|
373
373
|
//# sourceMappingURL=NotificationTemplatesPage.js.map
|