@krak-stack/notifications-admin 0.2.0 → 0.2.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/CHANGELOG.md +19 -0
- package/README.md +183 -3
- package/dist/atoms.d.ts +1 -0
- package/dist/atoms.js +33 -14
- package/dist/chunk-4r5x0qzz.js +522 -0
- package/dist/{chunk-wkxc1y7w.js → chunk-d32m2dmf.js} +160 -136
- package/dist/chunk-ghs5tkqn.js +37 -0
- package/dist/client-options.d.ts +9 -0
- package/dist/deliveries.d.ts +69 -1
- package/dist/deliveries.js +10 -2
- package/dist/delivery.atom.d.ts +95 -9
- package/dist/hooks.d.ts +21 -0
- package/dist/hooks.js +6 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +21 -3
- package/dist/operations.atom.d.ts +6 -4
- package/dist/operations.d.ts +39 -1
- package/dist/operations.js +8 -2
- package/dist/presentation.d.ts +13 -3
- package/package.json +7 -3
- package/dist/chunk-28xppc9m.js +0 -404
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn,
|
|
3
|
+
Button,
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogHeader,
|
|
7
|
+
DialogTitle
|
|
8
|
+
} from "./chunk-tck9drx2.js";
|
|
9
|
+
import {
|
|
10
|
+
NotificationTable2,
|
|
11
|
+
NotificationReference2
|
|
12
|
+
} from "./chunk-aqmv7g24.js";
|
|
13
|
+
|
|
14
|
+
// src/deliveries.tsx
|
|
15
|
+
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
16
|
+
|
|
17
|
+
// ../../src/components/ui/tabs.tsx
|
|
18
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
19
|
+
import { cva } from "class-variance-authority";
|
|
20
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
|
+
function Tabs({
|
|
22
|
+
className,
|
|
23
|
+
orientation = "horizontal",
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Root, {
|
|
27
|
+
"data-slot": "tabs",
|
|
28
|
+
"data-orientation": orientation,
|
|
29
|
+
className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
var tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-9 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
default: "bg-muted",
|
|
37
|
+
line: "gap-1 bg-transparent"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "default"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
function TabsList({
|
|
45
|
+
className,
|
|
46
|
+
variant = "default",
|
|
47
|
+
...props
|
|
48
|
+
}) {
|
|
49
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.List, {
|
|
50
|
+
"data-slot": "tabs-list",
|
|
51
|
+
"data-variant": variant,
|
|
52
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function TabsTrigger({ className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Tab, {
|
|
58
|
+
"data-slot": "tabs-trigger",
|
|
59
|
+
className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/deliveries.tsx
|
|
65
|
+
import { jsx as jsx2, jsxs, Fragment } from "react/jsx-runtime";
|
|
66
|
+
var metricKeys = [
|
|
67
|
+
"total",
|
|
68
|
+
"queued",
|
|
69
|
+
"processing",
|
|
70
|
+
"retrying",
|
|
71
|
+
"accepted",
|
|
72
|
+
"failed",
|
|
73
|
+
"suppressed",
|
|
74
|
+
"cancelled",
|
|
75
|
+
"feedbackCovered",
|
|
76
|
+
"feedbackUnavailable",
|
|
77
|
+
"confirmed",
|
|
78
|
+
"hardBounced",
|
|
79
|
+
"softBounced",
|
|
80
|
+
"complained"
|
|
81
|
+
];
|
|
82
|
+
var NotificationDeliveryOverview2 = (p) => {
|
|
83
|
+
const locale = useKrakstackLocale();
|
|
84
|
+
const labels = {
|
|
85
|
+
...p.messages.common.metrics,
|
|
86
|
+
feedbackCovered: p.messages.feedbackCovered,
|
|
87
|
+
feedbackUnavailable: p.messages.feedbackUnavailable
|
|
88
|
+
};
|
|
89
|
+
if (p.error)
|
|
90
|
+
return /* @__PURE__ */ jsx2("p", {
|
|
91
|
+
role: "alert",
|
|
92
|
+
children: p.error
|
|
93
|
+
});
|
|
94
|
+
if (!p.overview)
|
|
95
|
+
return p.pending ? /* @__PURE__ */ jsx2("p", {
|
|
96
|
+
role: "status",
|
|
97
|
+
children: p.messages.common.loading
|
|
98
|
+
}) : null;
|
|
99
|
+
const overview = p.overview;
|
|
100
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
101
|
+
className: "space-y-4",
|
|
102
|
+
"aria-busy": p.pending,
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsx2("p", {
|
|
105
|
+
children: p.messages.feedbackNotice
|
|
106
|
+
}),
|
|
107
|
+
(p.groups ?? [{ metrics: metricKeys }]).map((group, index) => /* @__PURE__ */ jsxs("section", {
|
|
108
|
+
"aria-label": group.label,
|
|
109
|
+
children: [
|
|
110
|
+
group.label && /* @__PURE__ */ jsx2("h2", {
|
|
111
|
+
className: "font-semibold",
|
|
112
|
+
children: group.label
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ jsx2("dl", {
|
|
115
|
+
className: p.variant === "rows" ? "divide-y" : "grid gap-3 sm:grid-cols-3",
|
|
116
|
+
children: group.metrics.map((key) => /* @__PURE__ */ jsxs("div", {
|
|
117
|
+
role: "group",
|
|
118
|
+
"aria-label": labels[key],
|
|
119
|
+
className: p.variant === "rows" ? "flex justify-between gap-4 py-2" : "rounded border p-3",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ jsx2("dt", {
|
|
122
|
+
children: labels[key]
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ jsx2("dd", {
|
|
125
|
+
className: "text-2xl font-semibold",
|
|
126
|
+
children: overview[key].toLocaleString(locale)
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}, key))
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
}, index))
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
var NotificationDeliveryActivity2 = (p) => {
|
|
137
|
+
const m = p.messages;
|
|
138
|
+
const c = m.common;
|
|
139
|
+
const columns = [
|
|
140
|
+
{ field: "recipientAddress", headerName: c.email },
|
|
141
|
+
{
|
|
142
|
+
field: "source",
|
|
143
|
+
headerName: m.source,
|
|
144
|
+
filterOptions: ["contacts", "engine"].map((value) => ({
|
|
145
|
+
value,
|
|
146
|
+
label: value === "contacts" ? m.sources.contacts : m.sources.engine
|
|
147
|
+
})),
|
|
148
|
+
cellRenderer: ({ data }) => m.sources[data.source]
|
|
149
|
+
},
|
|
150
|
+
{ field: "recipientUserId", headerName: m.recipientUserId },
|
|
151
|
+
{ field: "organizationId", headerName: m.organizationId },
|
|
152
|
+
{ field: "workspaceId", headerName: m.workspaceId },
|
|
153
|
+
{ field: "eventKey", headerName: m.eventKey },
|
|
154
|
+
{ field: "template", headerName: m.template },
|
|
155
|
+
{
|
|
156
|
+
field: "purpose",
|
|
157
|
+
headerName: c.purpose,
|
|
158
|
+
filterOptions: Object.entries(m.purposes).map(([value, label]) => ({
|
|
159
|
+
value,
|
|
160
|
+
label
|
|
161
|
+
})),
|
|
162
|
+
cellRenderer: ({ data }) => m.purposes[data.purpose]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
field: "status",
|
|
166
|
+
headerName: c.status,
|
|
167
|
+
filterOptions: Object.entries(c.statuses).map(([value, label]) => ({
|
|
168
|
+
value,
|
|
169
|
+
label
|
|
170
|
+
})),
|
|
171
|
+
cellRenderer: ({ data }) => c.statuses[data.status]
|
|
172
|
+
},
|
|
173
|
+
{ field: "attempts", headerName: c.attempts, type: "number" },
|
|
174
|
+
{ field: "provider", headerName: c.provider },
|
|
175
|
+
{ field: "createdAt", headerName: c.created, type: "date" },
|
|
176
|
+
{ field: "sentAt", headerName: c.accepted, type: "date" },
|
|
177
|
+
{
|
|
178
|
+
colId: "inspect",
|
|
179
|
+
headerName: c.inspect,
|
|
180
|
+
sortable: false,
|
|
181
|
+
searchable: false,
|
|
182
|
+
filterable: false,
|
|
183
|
+
hideable: false,
|
|
184
|
+
cellRenderer: ({ data }) => /* @__PURE__ */ jsx2(Button, {
|
|
185
|
+
variant: "outline",
|
|
186
|
+
onClick: () => p.onInspect(data.id),
|
|
187
|
+
children: c.inspect
|
|
188
|
+
})
|
|
189
|
+
}
|
|
190
|
+
];
|
|
191
|
+
return /* @__PURE__ */ jsx2(NotificationTable2, {
|
|
192
|
+
notificationTable: "delivery-activity",
|
|
193
|
+
rowData: p.error ? [] : p.activity?.items ?? [],
|
|
194
|
+
columnDefs: p.tableOptions?.columns?.(columns) ?? columns,
|
|
195
|
+
initialState: p.tableOptions?.initialState,
|
|
196
|
+
className: p.tableOptions?.className,
|
|
197
|
+
getRowId: (row) => row.id,
|
|
198
|
+
state: p.table,
|
|
199
|
+
onStateChange: p.onTable,
|
|
200
|
+
status: { loading: p.pending, error: p.error },
|
|
201
|
+
features: {
|
|
202
|
+
pagination: { mode: "server", rowCount: p.error ? 0 : p.total },
|
|
203
|
+
refresh: p.onRefresh
|
|
204
|
+
},
|
|
205
|
+
messages: {
|
|
206
|
+
en: { empty: c.empty, loading: c.loading },
|
|
207
|
+
fr: { empty: c.empty, loading: c.loading }
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
var NotificationAttemptHistory2 = (p) => {
|
|
212
|
+
const c = p.messages;
|
|
213
|
+
const columns = [
|
|
214
|
+
{ field: "generation", headerName: c.generation, type: "number" },
|
|
215
|
+
{ field: "attempt", headerName: c.attempts, type: "number" },
|
|
216
|
+
{
|
|
217
|
+
colId: "outcome",
|
|
218
|
+
headerName: c.outcome,
|
|
219
|
+
cellRenderer: ({ data }) => data.outcome ? c.outcomes[data.outcome._tag] : c.pending
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
colId: "reason",
|
|
223
|
+
headerName: c.reason,
|
|
224
|
+
cellRenderer: ({ data }) => {
|
|
225
|
+
const outcome = data.outcome;
|
|
226
|
+
if (!outcome)
|
|
227
|
+
return "—";
|
|
228
|
+
if (outcome._tag === "Sent")
|
|
229
|
+
return outcome.providerMessageId ?? "—";
|
|
230
|
+
if (outcome._tag === "Skipped")
|
|
231
|
+
return outcome.reason;
|
|
232
|
+
return outcome.message;
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{ field: "startedAt", headerName: c.started, type: "date" },
|
|
236
|
+
{ field: "completedAt", headerName: c.completed, type: "date" }
|
|
237
|
+
];
|
|
238
|
+
return /* @__PURE__ */ jsx2(NotificationTable2, {
|
|
239
|
+
notificationTable: p.tableId ?? "delivery-attempts",
|
|
240
|
+
rowData: p.error ? [] : p.attempts,
|
|
241
|
+
columnDefs: p.tableOptions?.columns?.(columns) ?? columns,
|
|
242
|
+
initialState: p.tableOptions?.initialState,
|
|
243
|
+
className: p.tableOptions?.className,
|
|
244
|
+
getRowId: (row) => row.id,
|
|
245
|
+
status: { loading: p.pending, error: p.error },
|
|
246
|
+
features: { pagination: { mode: "client" } },
|
|
247
|
+
messages: {
|
|
248
|
+
en: { empty: c.empty, loading: c.loading },
|
|
249
|
+
fr: { empty: c.empty, loading: c.loading }
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
var NotificationDeliveryDetails2 = (p) => {
|
|
254
|
+
const locale = useKrakstackLocale();
|
|
255
|
+
const m = p.messages;
|
|
256
|
+
const c = m.common;
|
|
257
|
+
if (p.error)
|
|
258
|
+
return /* @__PURE__ */ jsx2("p", {
|
|
259
|
+
role: "alert",
|
|
260
|
+
children: p.error
|
|
261
|
+
});
|
|
262
|
+
if (!p.inspection)
|
|
263
|
+
return /* @__PURE__ */ jsx2("p", {
|
|
264
|
+
role: "status",
|
|
265
|
+
children: c.loading
|
|
266
|
+
});
|
|
267
|
+
const { delivery, references, attempts } = p.inspection;
|
|
268
|
+
const date = (value) => value ? value.toLocaleString(locale) : "—";
|
|
269
|
+
const summary = [
|
|
270
|
+
{ label: c.email, value: delivery.recipientAddress },
|
|
271
|
+
{
|
|
272
|
+
label: m.recipientUserId,
|
|
273
|
+
value: /* @__PURE__ */ jsx2(NotificationReference2, {
|
|
274
|
+
kind: "account",
|
|
275
|
+
id: delivery.recipientUserId
|
|
276
|
+
})
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
label: m.organizationId,
|
|
280
|
+
value: /* @__PURE__ */ jsx2(NotificationReference2, {
|
|
281
|
+
kind: "organization",
|
|
282
|
+
id: delivery.organizationId
|
|
283
|
+
})
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
label: m.workspaceId,
|
|
287
|
+
value: /* @__PURE__ */ jsx2(NotificationReference2, {
|
|
288
|
+
kind: "workspace",
|
|
289
|
+
id: delivery.workspaceId
|
|
290
|
+
})
|
|
291
|
+
},
|
|
292
|
+
{ label: c.purpose, value: m.purposes[delivery.purpose] },
|
|
293
|
+
{ label: c.status, value: c.statuses[delivery.status] },
|
|
294
|
+
{ label: c.created, value: date(delivery.createdAt) },
|
|
295
|
+
{ label: c.scheduled, value: date(delivery.scheduledFor) },
|
|
296
|
+
{ label: c.accepted, value: date(delivery.sentAt) },
|
|
297
|
+
{ label: c.reason, value: delivery.errorMessage }
|
|
298
|
+
];
|
|
299
|
+
const sending = [
|
|
300
|
+
{
|
|
301
|
+
label: c.id,
|
|
302
|
+
value: /* @__PURE__ */ jsx2(NotificationReference2, {
|
|
303
|
+
kind: "delivery",
|
|
304
|
+
id: delivery.id
|
|
305
|
+
})
|
|
306
|
+
},
|
|
307
|
+
{ label: m.source, value: m.sources[delivery.source] },
|
|
308
|
+
{ label: m.eventKey, value: delivery.eventKey },
|
|
309
|
+
{ label: m.template, value: delivery.template },
|
|
310
|
+
{ label: c.provider, value: delivery.provider },
|
|
311
|
+
{ label: c.providerMessageId, value: delivery.providerMessageId },
|
|
312
|
+
{
|
|
313
|
+
label: c.attempts,
|
|
314
|
+
value: `${delivery.attempts} / ${delivery.maxAttempts}`
|
|
315
|
+
},
|
|
316
|
+
{ label: c.updated, value: date(delivery.updatedAt) }
|
|
317
|
+
];
|
|
318
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
319
|
+
className: "space-y-6",
|
|
320
|
+
"aria-busy": p.pending,
|
|
321
|
+
children: [
|
|
322
|
+
[
|
|
323
|
+
{ label: m.sections?.summary ?? c.views.overview, fields: summary },
|
|
324
|
+
{ label: m.sections?.sending ?? c.provider, fields: sending }
|
|
325
|
+
].map((section, index) => /* @__PURE__ */ jsxs("section", {
|
|
326
|
+
"aria-label": section.label,
|
|
327
|
+
children: [
|
|
328
|
+
/* @__PURE__ */ jsx2("h2", {
|
|
329
|
+
className: "font-semibold",
|
|
330
|
+
children: section.label
|
|
331
|
+
}),
|
|
332
|
+
/* @__PURE__ */ jsx2("dl", {
|
|
333
|
+
className: "grid gap-2 break-words sm:grid-cols-2",
|
|
334
|
+
children: section.fields.map((field, index) => /* @__PURE__ */ jsxs("div", {
|
|
335
|
+
children: [
|
|
336
|
+
/* @__PURE__ */ jsx2("dt", {
|
|
337
|
+
className: "font-semibold",
|
|
338
|
+
children: field.label
|
|
339
|
+
}),
|
|
340
|
+
/* @__PURE__ */ jsx2("dd", {
|
|
341
|
+
children: field.value ?? "—"
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
}, index))
|
|
345
|
+
})
|
|
346
|
+
]
|
|
347
|
+
}, index)),
|
|
348
|
+
delivery.contactId && p.onContact && /* @__PURE__ */ jsx2(Button, {
|
|
349
|
+
variant: "outline",
|
|
350
|
+
onClick: () => {
|
|
351
|
+
if (delivery.contactId)
|
|
352
|
+
p.onContact?.(delivery.contactId);
|
|
353
|
+
},
|
|
354
|
+
children: c.contactId
|
|
355
|
+
}),
|
|
356
|
+
delivery.campaignId && p.onCampaign && /* @__PURE__ */ jsx2(Button, {
|
|
357
|
+
variant: "outline",
|
|
358
|
+
onClick: () => {
|
|
359
|
+
if (delivery.campaignId)
|
|
360
|
+
p.onCampaign?.(delivery.campaignId);
|
|
361
|
+
},
|
|
362
|
+
children: c.campaign
|
|
363
|
+
}),
|
|
364
|
+
references.length > 0 && /* @__PURE__ */ jsxs("section", {
|
|
365
|
+
"aria-label": m.references,
|
|
366
|
+
children: [
|
|
367
|
+
/* @__PURE__ */ jsx2("h2", {
|
|
368
|
+
className: "font-semibold",
|
|
369
|
+
children: m.references
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ jsx2("dl", {
|
|
372
|
+
children: references.map((ref) => /* @__PURE__ */ jsxs("div", {
|
|
373
|
+
children: [
|
|
374
|
+
/* @__PURE__ */ jsx2("dt", {
|
|
375
|
+
children: ref.namespace
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ jsx2("dd", {
|
|
378
|
+
children: /* @__PURE__ */ jsx2(NotificationReference2, {
|
|
379
|
+
kind: ref.namespace,
|
|
380
|
+
id: ref.value
|
|
381
|
+
})
|
|
382
|
+
})
|
|
383
|
+
]
|
|
384
|
+
}, `${ref.namespace}:${ref.value}`))
|
|
385
|
+
})
|
|
386
|
+
]
|
|
387
|
+
}),
|
|
388
|
+
/* @__PURE__ */ jsxs("section", {
|
|
389
|
+
"aria-label": c.attempts,
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ jsx2("h2", {
|
|
392
|
+
className: "font-semibold",
|
|
393
|
+
children: c.attempts
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ jsx2(NotificationAttemptHistory2, {
|
|
396
|
+
messages: c,
|
|
397
|
+
attempts
|
|
398
|
+
})
|
|
399
|
+
]
|
|
400
|
+
})
|
|
401
|
+
]
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
var NotificationDeliveries2 = (p) => {
|
|
405
|
+
const m = p.messages;
|
|
406
|
+
const c = m.common;
|
|
407
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
408
|
+
className: "space-y-4",
|
|
409
|
+
"aria-busy": p.pending,
|
|
410
|
+
children: [
|
|
411
|
+
p.header !== false && /* @__PURE__ */ jsxs("header", {
|
|
412
|
+
className: "flex justify-between gap-4",
|
|
413
|
+
children: [
|
|
414
|
+
/* @__PURE__ */ jsxs("div", {
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsx2("h1", {
|
|
417
|
+
className: "text-2xl font-semibold",
|
|
418
|
+
children: m.title
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ jsx2("p", {
|
|
421
|
+
children: m.description
|
|
422
|
+
})
|
|
423
|
+
]
|
|
424
|
+
}),
|
|
425
|
+
/* @__PURE__ */ jsx2(Button, {
|
|
426
|
+
variant: "outline",
|
|
427
|
+
onClick: p.onRefresh,
|
|
428
|
+
children: c.refresh
|
|
429
|
+
})
|
|
430
|
+
]
|
|
431
|
+
}),
|
|
432
|
+
p.sourcePicker !== false && /* @__PURE__ */ jsx2(Tabs, {
|
|
433
|
+
value: p.source,
|
|
434
|
+
onValueChange: (value) => {
|
|
435
|
+
if (value === "all" || value === "contacts" || value === "engine")
|
|
436
|
+
p.onSource(value);
|
|
437
|
+
},
|
|
438
|
+
children: /* @__PURE__ */ jsx2(TabsList, {
|
|
439
|
+
"aria-label": m.source,
|
|
440
|
+
children: ["all", "contacts", "engine"].map((source) => /* @__PURE__ */ jsx2(TabsTrigger, {
|
|
441
|
+
value: source,
|
|
442
|
+
children: m.sources[source]
|
|
443
|
+
}, source))
|
|
444
|
+
})
|
|
445
|
+
}),
|
|
446
|
+
p.navigation !== false && /* @__PURE__ */ jsx2(Tabs, {
|
|
447
|
+
value: p.view,
|
|
448
|
+
onValueChange: (value) => {
|
|
449
|
+
if (value === "overview" || value === "activity")
|
|
450
|
+
p.onView(value);
|
|
451
|
+
},
|
|
452
|
+
children: /* @__PURE__ */ jsx2(TabsList, {
|
|
453
|
+
"aria-label": m.title,
|
|
454
|
+
children: ["overview", "activity"].map((view) => /* @__PURE__ */ jsx2(TabsTrigger, {
|
|
455
|
+
value: view,
|
|
456
|
+
children: c.views[view]
|
|
457
|
+
}, view))
|
|
458
|
+
})
|
|
459
|
+
}),
|
|
460
|
+
p.view === "overview" ? /* @__PURE__ */ jsx2(NotificationDeliveryOverview2, {
|
|
461
|
+
messages: m,
|
|
462
|
+
overview: p.overview,
|
|
463
|
+
pending: p.pending,
|
|
464
|
+
error: p.error
|
|
465
|
+
}) : /* @__PURE__ */ jsxs(Fragment, {
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ jsx2("p", {
|
|
468
|
+
children: m.feedbackNotice
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ jsx2(NotificationDeliveryActivity2, {
|
|
471
|
+
messages: m,
|
|
472
|
+
activity: p.activity,
|
|
473
|
+
pending: p.pending,
|
|
474
|
+
error: p.error,
|
|
475
|
+
table: p.table,
|
|
476
|
+
total: p.total,
|
|
477
|
+
onTable: p.onTable,
|
|
478
|
+
onInspect: p.onInspect,
|
|
479
|
+
onRefresh: p.onRefresh,
|
|
480
|
+
tableOptions: p.tableOptions
|
|
481
|
+
})
|
|
482
|
+
]
|
|
483
|
+
}),
|
|
484
|
+
/* @__PURE__ */ jsx2(Dialog, {
|
|
485
|
+
open: p.inspecting,
|
|
486
|
+
onOpenChange: (open) => {
|
|
487
|
+
if (!open)
|
|
488
|
+
p.onInspect(undefined);
|
|
489
|
+
},
|
|
490
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
491
|
+
className: "max-h-[90vh] overflow-auto sm:max-w-4xl",
|
|
492
|
+
children: [
|
|
493
|
+
/* @__PURE__ */ jsx2(DialogHeader, {
|
|
494
|
+
children: /* @__PURE__ */ jsx2(DialogTitle, {
|
|
495
|
+
children: c.inspect
|
|
496
|
+
})
|
|
497
|
+
}),
|
|
498
|
+
/* @__PURE__ */ jsx2(NotificationDeliveryDetails2, {
|
|
499
|
+
messages: m,
|
|
500
|
+
inspection: p.inspection,
|
|
501
|
+
error: p.error ?? p.inspectionError,
|
|
502
|
+
onContact: p.onContact,
|
|
503
|
+
onCampaign: p.onCampaign
|
|
504
|
+
}),
|
|
505
|
+
/* @__PURE__ */ jsx2(Button, {
|
|
506
|
+
variant: "outline",
|
|
507
|
+
onClick: p.onRefresh,
|
|
508
|
+
children: c.refresh
|
|
509
|
+
}),
|
|
510
|
+
/* @__PURE__ */ jsx2(Button, {
|
|
511
|
+
variant: "outline",
|
|
512
|
+
onClick: () => p.onInspect(undefined),
|
|
513
|
+
children: c.close
|
|
514
|
+
})
|
|
515
|
+
]
|
|
516
|
+
})
|
|
517
|
+
})
|
|
518
|
+
]
|
|
519
|
+
});
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
export { Tabs, TabsList, TabsTrigger, NotificationDeliveryOverview2, NotificationDeliveryActivity2, NotificationAttemptHistory2, NotificationDeliveryDetails2, NotificationDeliveries2 };
|