@burdenoff/microfe-channel 2026.624.1 → 2026.624.3

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.
@@ -4,167 +4,234 @@ import { PermissionGuard as n } from "../../../components/PermissionGuard.js";
4
4
  import { CHANNEL_PERMISSIONS as r } from "../../../constants/permissions.js";
5
5
  import { useExportDeliveryAttempts as i } from "../hooks/useExport.js";
6
6
  import { useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
7
- import { useI18n as ee } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
- import { AlertCircle as l, ArrowLeft as u, CheckCircle2 as d, ChevronLeft as te, ChevronRight as ne, Clock as f, Download as p, Loader2 as m, RefreshCw as h, RotateCcw as g, Send as _, XCircle as v } from "lucide-react";
9
- import { useNavigate as y, useParams as b } from "react-router-dom";
10
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
7
+ import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
+ import { AlertCircle as u, ArrowLeft as d, CheckCircle2 as f, ChevronLeft as ee, ChevronRight as p, Clock as m, Download as h, Loader2 as g, RefreshCw as _, RotateCcw as te, Send as v, XCircle as y } from "lucide-react";
9
+ import { useNavigate as b, useParams as x } from "react-router-dom";
10
+ import { Fragment as ne, jsx as S, jsxs as C } from "react/jsx-runtime";
11
+ import { ResponsiveTable as w } from "@burdenoff/fe-libs/ui";
11
12
  //#region src/channel/modules/channels/pages/DeliveryHistoryPage.tsx
12
- var w = {
13
+ var T = {
13
14
  PENDING: {
14
15
  label: "Pending",
15
16
  color: "text-text-secondary bg-bg-sunken",
16
- icon: f
17
+ icon: m
17
18
  },
18
19
  QUEUED: {
19
20
  label: "Queued",
20
21
  color: "text-accent-primary bg-accent-primary-subtle",
21
- icon: f
22
+ icon: m
22
23
  },
23
24
  SENDING: {
24
25
  label: "Sending",
25
26
  color: "text-accent-primary bg-accent-primary/10",
26
- icon: _
27
+ icon: v
27
28
  },
28
29
  SENT: {
29
30
  label: "Sent",
30
31
  color: "text-status-success-text bg-status-success-bg-subtle",
31
- icon: d
32
+ icon: f
32
33
  },
33
34
  DELIVERED: {
34
35
  label: "Delivered",
35
36
  color: "text-status-success-text bg-status-success-bg-subtle",
36
- icon: d
37
+ icon: f
37
38
  },
38
39
  FAILED: {
39
40
  label: "Failed",
40
41
  color: "text-status-error-text bg-status-error-bg-subtle",
41
- icon: v
42
+ icon: y
42
43
  },
43
44
  BOUNCED: {
44
45
  label: "Bounced",
45
46
  color: "text-status-warning-text bg-status-warning-bg-subtle",
46
- icon: l
47
+ icon: u
47
48
  },
48
49
  REJECTED: {
49
50
  label: "Rejected",
50
51
  color: "text-status-error-text bg-status-error-bg-subtle",
51
- icon: v
52
+ icon: y
52
53
  },
53
54
  RATE_LIMITED: {
54
55
  label: "Rate Limited",
55
56
  color: "text-status-warning-text bg-status-warning-bg-subtle",
56
- icon: f
57
+ icon: m
57
58
  },
58
59
  RETRYING: {
59
60
  label: "Retrying",
60
61
  color: "text-accent-primary bg-accent-primary/10",
61
- icon: h
62
+ icon: _
62
63
  },
63
64
  OPENED: {
64
65
  label: "Opened",
65
66
  color: "text-status-success-text bg-status-success-bg-subtle",
66
- icon: d
67
+ icon: f
67
68
  },
68
69
  CLICKED: {
69
70
  label: "Clicked",
70
71
  color: "text-status-success-text bg-status-success-bg-subtle",
71
- icon: d
72
+ icon: f
72
73
  }
73
74
  };
74
- function T() {
75
- let { channelId: d } = b(), f = y(), { t: v } = ee(), T = (e, t) => {
76
- let n = v(e);
75
+ function E() {
76
+ let { channelId: f } = x(), m = b(), { t: y } = l(), E = (e, t) => {
77
+ let n = y(e);
77
78
  return n === e ? t : n;
78
- }, { organizationId: E } = e(), { triggerExport: re, isExporting: D, exportError: O } = i(E ?? void 0, d), [k, A] = c(!0), [j, M] = c([]), [N, P] = c(null), [F, I] = c(null), [L, R] = c(25), [z, B] = c(0), [V, H] = c([void 0]), [U, W] = c(0), { channel: G, isLoading: K, error: q, fetchDeliveryAttempts: J, retryDelivery: Y } = t(d), X = a(async (e) => {
79
- if (d) {
80
- A(!0), I(null);
79
+ }, { organizationId: D } = e(), { triggerExport: re, isExporting: O, exportError: k } = i(D ?? void 0, f), [A, j] = c(!0), [M, N] = c([]), [P, F] = c(null), [I, L] = c(null), [R, z] = c(25), [B, V] = c(0), [H, U] = c([void 0]), [W, G] = c(0), { channel: K, isLoading: q, error: J, fetchDeliveryAttempts: Y, retryDelivery: ie } = t(f), X = a(async (e) => {
80
+ if (f) {
81
+ j(!0), L(null);
81
82
  try {
82
- let t = await J(L, e);
83
- return M(t.items), B(t.total), t.nextCursor;
83
+ let t = await Y(R, e);
84
+ return N(t.items), V(t.total), t.nextCursor;
84
85
  } finally {
85
- A(!1);
86
+ j(!1);
86
87
  }
87
88
  }
88
89
  }, [
89
- d,
90
- J,
91
- L
92
- ]), Z = s(X), Q = s(V);
90
+ f,
91
+ Y,
92
+ R
93
+ ]), Z = s(X), Q = s(H);
93
94
  o(() => {
94
- Z.current = X, Q.current = V;
95
+ Z.current = X, Q.current = H;
95
96
  });
96
97
  let $ = s(!0);
97
98
  o(() => {
98
99
  Promise.resolve().then(() => {
99
- H([void 0]), W(0), Z.current(void 0);
100
+ U([void 0]), G(0), Z.current(void 0);
100
101
  });
101
- }, [L]), o(() => {
102
+ }, [R]), o(() => {
102
103
  if ($.current) {
103
104
  $.current = !1;
104
105
  return;
105
106
  }
106
- Promise.resolve().then(() => Z.current(Q.current[U]));
107
- }, [U]), o(() => {
108
- if (!d || U !== 0) return;
107
+ Promise.resolve().then(() => Z.current(Q.current[W]));
108
+ }, [W]), o(() => {
109
+ if (!f || W !== 0) return;
109
110
  let e = setInterval(() => {
110
111
  X(void 0);
111
112
  }, 6e4);
112
113
  return () => clearInterval(e);
113
114
  }, [
114
- d,
115
- U,
115
+ f,
116
+ W,
116
117
  X
117
118
  ]);
118
- let ie = a(async () => {
119
- let e = await X(V[U]);
120
- e && H((t) => {
119
+ let ae = a(async () => {
120
+ let e = await X(H[W]);
121
+ e && U((t) => {
121
122
  let n = [...t];
122
- return n[U + 1] || (n[U + 1] = e), n;
123
- }), W((e) => e + 1);
123
+ return n[W + 1] || (n[W + 1] = e), n;
124
+ }), G((e) => e + 1);
124
125
  }, [
125
- V,
126
- U,
126
+ H,
127
+ W,
127
128
  X
128
- ]), ae = a(() => {
129
- let e = U - 1;
130
- W(e), X(V[e]);
129
+ ]), oe = a(() => {
130
+ let e = W - 1;
131
+ G(e), X(H[e]);
131
132
  }, [
132
- V,
133
- U,
133
+ H,
134
+ W,
134
135
  X
135
- ]), oe = j.length === L, se = U > 0, ce = async (e) => {
136
- P(e), I(null);
136
+ ]), se = M.length === R, ce = W > 0, le = async (e) => {
137
+ F(e), L(null);
137
138
  try {
138
- let t = await Y(e);
139
- t.success ? await X(V[U]) : I(t.error || "Retry failed");
139
+ let t = await ie(e);
140
+ t.success ? await X(H[W]) : L(t.error || "Retry failed");
140
141
  } finally {
141
- P(null);
142
+ F(null);
143
+ }
144
+ }, ue = (e) => T[e] || T.PENDING, de = [
145
+ {
146
+ key: "status",
147
+ header: E("channel.status", "Status"),
148
+ priority: "primary",
149
+ cell: (e) => {
150
+ let t = ue(e.status), n = t.icon;
151
+ return /* @__PURE__ */ C("div", {
152
+ className: "flex items-center gap-2",
153
+ children: [/* @__PURE__ */ S(n, {
154
+ size: 14,
155
+ className: t.color.split(" ")[0]
156
+ }), /* @__PURE__ */ S("span", {
157
+ className: `text-sm font-medium ${t.color}`,
158
+ children: t.label
159
+ })]
160
+ });
161
+ }
162
+ },
163
+ {
164
+ key: "content",
165
+ header: E("channel.content", "Content"),
166
+ priority: "primary",
167
+ cellClassName: "text-sm text-text-primary truncate max-w-xs",
168
+ cell: (e) => e.content
169
+ },
170
+ {
171
+ key: "sentAt",
172
+ header: E("channel.sentAt", "Sent At"),
173
+ priority: "secondary",
174
+ cellClassName: "text-sm text-text-secondary",
175
+ cell: (e) => e.sentAt ? new Date(e.sentAt).toLocaleString() : "-"
176
+ },
177
+ {
178
+ key: "retries",
179
+ header: E("channel.retries", "Retries"),
180
+ priority: "secondary",
181
+ cellClassName: "text-sm text-text-secondary tabular-nums",
182
+ cell: (e) => e.retryCount
183
+ },
184
+ {
185
+ key: "error",
186
+ header: E("channel.error", "Error"),
187
+ priority: "secondary",
188
+ cellClassName: "text-sm text-status-error-text max-w-xs truncate",
189
+ cell: (e) => e.errorMessage || "-"
190
+ },
191
+ {
192
+ key: "actions",
193
+ header: E("channel.actions", "Actions"),
194
+ priority: "secondary",
195
+ cell: (e) => e.status === "FAILED" || e.status === "BOUNCED" || e.status === "REJECTED" ? /* @__PURE__ */ S(n, {
196
+ permission: r.CHANNEL_DELIVERY_EXECUTE,
197
+ children: /* @__PURE__ */ C("button", {
198
+ type: "button",
199
+ onClick: () => le(e.id),
200
+ disabled: P === e.id,
201
+ className: "flex items-center gap-1 px-2 py-1 text-xs font-medium text-accent-primary hover:bg-accent-primary/10 rounded transition-colors disabled:opacity-50",
202
+ title: E("channel.retryDelivery", "Retry this delivery"),
203
+ children: [/* @__PURE__ */ S(te, {
204
+ size: 12,
205
+ className: P === e.id ? "animate-spin" : ""
206
+ }), P === e.id ? E("channel.retrying", "Retrying...") : E("channel.retry", "Retry")]
207
+ })
208
+ }) : null
142
209
  }
143
- }, le = (e) => w[e] || w.PENDING;
144
- return K ? /* @__PURE__ */ S("output", {
210
+ ];
211
+ return q ? /* @__PURE__ */ S("output", {
145
212
  className: "flex items-center justify-center min-h-screen",
146
- "aria-label": T("channel.loading", "Loading"),
147
- children: /* @__PURE__ */ S(m, {
213
+ "aria-label": E("channel.loading", "Loading"),
214
+ children: /* @__PURE__ */ S(g, {
148
215
  size: 32,
149
216
  className: "animate-spin text-accent-primary",
150
217
  "aria-hidden": "true"
151
218
  })
152
- }) : q || !G ? /* @__PURE__ */ S("div", {
219
+ }) : J || !K ? /* @__PURE__ */ S("div", {
153
220
  className: "p-6",
154
221
  children: /* @__PURE__ */ C("div", {
155
222
  className: "flex items-center gap-3 p-4 bg-status-error-bg-subtle border border-status-error-border rounded-lg",
156
223
  children: [
157
- /* @__PURE__ */ S(l, {
224
+ /* @__PURE__ */ S(u, {
158
225
  size: 20,
159
226
  className: "text-status-error-text"
160
227
  }),
161
228
  /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S("p", {
162
229
  className: "text-sm font-medium text-status-error-text",
163
- children: q || "Channel not found"
230
+ children: J || "Channel not found"
164
231
  }) }),
165
232
  /* @__PURE__ */ S("button", {
166
233
  type: "button",
167
- onClick: () => f(`/channels/${d}`),
234
+ onClick: () => m(`/channels/${f}`),
168
235
  className: "ml-auto px-3 py-1 text-sm text-status-error-text hover:bg-status-error-bg-subtle rounded transition-colors",
169
236
  children: "Go Back"
170
237
  })
@@ -181,26 +248,26 @@ function T() {
181
248
  className: "flex items-center gap-3",
182
249
  children: [/* @__PURE__ */ S("button", {
183
250
  type: "button",
184
- onClick: () => f(`/channels/${d}`),
185
- "aria-label": T("channel.backToChannel", "Back to channel"),
251
+ onClick: () => m(`/channels/${f}`),
252
+ "aria-label": E("channel.backToChannel", "Back to channel"),
186
253
  className: "p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-lg transition-colors",
187
- children: /* @__PURE__ */ S(u, {
254
+ children: /* @__PURE__ */ S(d, {
188
255
  size: 20,
189
256
  "aria-hidden": "true"
190
257
  })
191
258
  }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h1", {
192
259
  className: "text-xl sm:text-2xl font-bold text-text-primary",
193
- children: T("channel.deliveryHistory", "Delivery History")
260
+ children: E("channel.deliveryHistory", "Delivery History")
194
261
  }), /* @__PURE__ */ C("p", {
195
262
  className: "text-sm text-text-secondary mt-1",
196
- children: [G.name, " - Message deliveries"]
263
+ children: [K.name, " - Message deliveries"]
197
264
  })] })]
198
265
  }), /* @__PURE__ */ C("div", {
199
266
  className: "flex items-center gap-3",
200
267
  children: [
201
268
  /* @__PURE__ */ C("select", {
202
- value: L,
203
- onChange: (e) => R(Number(e.target.value)),
269
+ value: R,
270
+ onChange: (e) => z(Number(e.target.value)),
204
271
  className: "px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 text-text-primary",
205
272
  children: [
206
273
  /* @__PURE__ */ S("option", {
@@ -223,57 +290,57 @@ function T() {
223
290
  }),
224
291
  /* @__PURE__ */ C("button", {
225
292
  type: "button",
226
- onClick: () => void X(V[U]),
227
- disabled: k,
293
+ onClick: () => void X(H[W]),
294
+ disabled: A,
228
295
  className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-lg transition-colors disabled:opacity-50",
229
- children: [/* @__PURE__ */ S(h, {
296
+ children: [/* @__PURE__ */ S(_, {
230
297
  size: 16,
231
- className: k ? "animate-spin" : ""
232
- }), T("channel.refresh", "Refresh")]
298
+ className: A ? "animate-spin" : ""
299
+ }), E("channel.refresh", "Refresh")]
233
300
  }),
234
301
  /* @__PURE__ */ S(n, {
235
302
  permission: r.CHANNEL_DELIVERY_EXPORT,
236
303
  children: /* @__PURE__ */ C("button", {
237
304
  type: "button",
238
305
  onClick: () => void re(),
239
- disabled: D,
306
+ disabled: O,
240
307
  className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-fg border border-border-subtle hover:bg-bg-elevated rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
241
- title: T("channel.exportCSV", "Export to CSV"),
242
- children: [D ? /* @__PURE__ */ S(m, {
308
+ title: E("channel.exportCSV", "Export to CSV"),
309
+ children: [O ? /* @__PURE__ */ S(g, {
243
310
  size: 16,
244
311
  className: "animate-spin"
245
- }) : /* @__PURE__ */ S(p, { size: 16 }), T("channel.export", "Export")]
312
+ }) : /* @__PURE__ */ S(h, { size: 16 }), E("channel.export", "Export")]
246
313
  })
247
314
  })
248
315
  ]
249
316
  })]
250
317
  }),
251
- O && /* @__PURE__ */ C("div", {
318
+ k && /* @__PURE__ */ C("div", {
252
319
  className: "p-4 bg-status-error-bg-subtle border border-status-error-border rounded-lg flex items-center gap-3",
253
- children: [/* @__PURE__ */ S(l, {
320
+ children: [/* @__PURE__ */ S(u, {
254
321
  size: 20,
255
322
  className: "text-status-error-text"
256
323
  }), /* @__PURE__ */ S("p", {
257
324
  className: "text-sm text-status-error-text flex-1",
258
- children: O
325
+ children: k
259
326
  })]
260
327
  }),
261
- F && /* @__PURE__ */ C("div", {
328
+ I && /* @__PURE__ */ C("div", {
262
329
  className: "p-4 bg-status-error-bg-subtle border border-status-error-border rounded-lg flex items-center gap-3",
263
330
  children: [
264
- /* @__PURE__ */ S(l, {
331
+ /* @__PURE__ */ S(u, {
265
332
  size: 20,
266
333
  className: "text-status-error-text"
267
334
  }),
268
335
  /* @__PURE__ */ S("p", {
269
336
  className: "text-sm text-status-error-text flex-1",
270
- children: F
337
+ children: I
271
338
  }),
272
339
  /* @__PURE__ */ S("button", {
273
340
  type: "button",
274
- onClick: () => I(null),
341
+ onClick: () => L(null),
275
342
  className: "text-status-error-text hover:text-status-error-text",
276
- children: T("channel.dismiss", "Dismiss")
343
+ children: E("channel.dismiss", "Dismiss")
277
344
  })
278
345
  ]
279
346
  }),
@@ -284,163 +351,71 @@ function T() {
284
351
  children: "Delivery history shows all message attempts sent through this channel. Data is retained for 7 days. Click retry on a failed delivery to attempt sending again."
285
352
  })
286
353
  }),
287
- /* @__PURE__ */ S("div", {
288
- className: "bg-surface border border-border-subtle rounded-lg overflow-hidden",
289
- children: /* @__PURE__ */ S("div", {
290
- className: "overflow-x-auto min-w-full",
291
- children: /* @__PURE__ */ C("table", {
292
- className: "w-full min-w-[700px]",
293
- children: [/* @__PURE__ */ S("thead", {
294
- className: "bg-bg-sunken/50 border-b border-border-subtle",
295
- children: /* @__PURE__ */ C("tr", { children: [
296
- /* @__PURE__ */ S("th", {
297
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
298
- children: T("channel.status", "Status")
299
- }),
300
- /* @__PURE__ */ S("th", {
301
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
302
- children: T("channel.content", "Content")
303
- }),
304
- /* @__PURE__ */ S("th", {
305
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
306
- children: T("channel.sentAt", "Sent At")
307
- }),
308
- /* @__PURE__ */ S("th", {
309
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
310
- children: T("channel.retries", "Retries")
311
- }),
312
- /* @__PURE__ */ S("th", {
313
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
314
- children: T("channel.error", "Error")
315
- }),
316
- /* @__PURE__ */ S("th", {
317
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
318
- children: T("channel.actions", "Actions")
319
- })
320
- ] })
321
- }), /* @__PURE__ */ S("tbody", {
322
- className: "divide-y divide-border",
323
- children: k ? /* @__PURE__ */ S("tr", { children: /* @__PURE__ */ C("td", {
324
- colSpan: 6,
325
- className: "px-4 py-12 text-center",
326
- children: [/* @__PURE__ */ S(m, {
327
- size: 24,
328
- className: "animate-spin text-accent-primary mx-auto"
329
- }), /* @__PURE__ */ S("p", {
330
- className: "text-sm text-text-secondary mt-2",
331
- children: "Loading delivery attempts…"
332
- })]
333
- }) }) : j.length === 0 ? /* @__PURE__ */ S("tr", { children: /* @__PURE__ */ S("td", {
334
- colSpan: 6,
335
- className: "px-4 py-12 text-center",
336
- children: /* @__PURE__ */ C("div", {
337
- className: "flex flex-col items-center gap-2",
338
- children: [
339
- /* @__PURE__ */ S(_, {
340
- size: 32,
341
- className: "text-text-secondary"
342
- }),
343
- /* @__PURE__ */ S("p", {
344
- className: "text-sm font-medium text-text-primary",
345
- children: T("channel.noDeliveryAttempts", "No delivery attempts yet")
346
- }),
347
- /* @__PURE__ */ S("p", {
348
- className: "text-xs text-text-secondary",
349
- children: T("channel.sendMessageToSeeHistory", "Send a message through this channel to see delivery history")
350
- })
351
- ]
352
- })
353
- }) }) : j.map((e) => {
354
- let t = le(e.status), i = t.icon, a = e.status === "FAILED" || e.status === "BOUNCED" || e.status === "REJECTED";
355
- return /* @__PURE__ */ C("tr", {
356
- className: "hover:bg-bg-sunken/30 transition-colors",
357
- children: [
358
- /* @__PURE__ */ S("td", {
359
- className: "px-4 py-3",
360
- children: /* @__PURE__ */ C("div", {
361
- className: "flex items-center gap-2",
362
- children: [/* @__PURE__ */ S(i, {
363
- size: 14,
364
- className: t.color.split(" ")[0]
365
- }), /* @__PURE__ */ S("span", {
366
- className: `text-sm font-medium ${t.color}`,
367
- children: t.label
368
- })]
369
- })
370
- }),
371
- /* @__PURE__ */ S("td", {
372
- className: "px-4 py-3 text-sm text-text-primary truncate max-w-xs",
373
- children: e.content
374
- }),
375
- /* @__PURE__ */ S("td", {
376
- className: "px-4 py-3 text-sm text-text-secondary",
377
- children: e.sentAt ? new Date(e.sentAt).toLocaleString() : "-"
378
- }),
379
- /* @__PURE__ */ S("td", {
380
- className: "px-4 py-3 text-sm text-text-secondary",
381
- children: e.retryCount
382
- }),
383
- /* @__PURE__ */ S("td", {
384
- className: "px-4 py-3 text-sm text-status-error-text max-w-xs truncate",
385
- children: e.errorMessage || "-"
386
- }),
387
- /* @__PURE__ */ S("td", {
388
- className: "px-4 py-3",
389
- children: a && /* @__PURE__ */ S(n, {
390
- permission: r.CHANNEL_DELIVERY_EXECUTE,
391
- children: /* @__PURE__ */ C("button", {
392
- type: "button",
393
- onClick: () => ce(e.id),
394
- disabled: N === e.id,
395
- className: "flex items-center gap-1 px-2 py-1 text-xs font-medium text-accent-primary hover:bg-accent-primary/10 rounded transition-colors disabled:opacity-50",
396
- title: T("channel.retryDelivery", "Retry this delivery"),
397
- children: [/* @__PURE__ */ S(g, {
398
- size: 12,
399
- className: N === e.id ? "animate-spin" : ""
400
- }), N === e.id ? T("channel.retrying", "Retrying...") : T("channel.retry", "Retry")]
401
- })
402
- })
403
- })
404
- ]
405
- }, e.id);
406
- })
407
- })]
408
- })
354
+ A ? /* @__PURE__ */ C("div", {
355
+ className: "bg-surface border border-border-subtle rounded-lg px-4 py-12 text-center",
356
+ children: [/* @__PURE__ */ S(g, {
357
+ size: 24,
358
+ className: "animate-spin text-accent-primary mx-auto"
359
+ }), /* @__PURE__ */ S("p", {
360
+ className: "text-sm text-text-secondary mt-2",
361
+ children: "Loading delivery attempts…"
362
+ })]
363
+ }) : /* @__PURE__ */ S(w, {
364
+ columns: de,
365
+ data: M,
366
+ rowKey: (e) => e.id,
367
+ className: "bg-surface border border-border-subtle rounded-lg",
368
+ emptyState: /* @__PURE__ */ C("div", {
369
+ className: "flex flex-col items-center gap-2 py-8",
370
+ children: [
371
+ /* @__PURE__ */ S(v, {
372
+ size: 32,
373
+ className: "text-text-secondary"
374
+ }),
375
+ /* @__PURE__ */ S("p", {
376
+ className: "text-sm font-medium text-text-primary",
377
+ children: E("channel.noDeliveryAttempts", "No delivery attempts yet")
378
+ }),
379
+ /* @__PURE__ */ S("p", {
380
+ className: "text-xs text-text-secondary",
381
+ children: E("channel.sendMessageToSeeHistory", "Send a message through this channel to see delivery history")
382
+ })
383
+ ]
409
384
  })
410
385
  }),
411
386
  /* @__PURE__ */ C("div", {
412
387
  className: "flex items-center justify-between",
413
388
  children: [/* @__PURE__ */ S("p", {
414
389
  className: "text-sm text-text-secondary",
415
- children: z > 0 && /* @__PURE__ */ C(x, { children: [
416
- T("channel.page", "Page"),
390
+ children: B > 0 && /* @__PURE__ */ C(ne, { children: [
391
+ E("channel.page", "Page"),
417
392
  " ",
418
393
  /* @__PURE__ */ S("span", {
419
394
  className: "font-medium",
420
- children: U + 1
395
+ children: W + 1
421
396
  }),
422
397
  " · ",
423
- T("channel.totalRecords", "Total"),
398
+ E("channel.totalRecords", "Total"),
424
399
  ": ",
425
400
  /* @__PURE__ */ S("span", {
426
401
  className: "font-medium",
427
- children: z
402
+ children: B
428
403
  })
429
404
  ] })
430
405
  }), /* @__PURE__ */ C("div", {
431
406
  className: "flex items-center gap-2",
432
407
  children: [/* @__PURE__ */ C("button", {
433
408
  type: "button",
434
- onClick: ae,
435
- disabled: !se || k,
409
+ onClick: oe,
410
+ disabled: !ce || A,
436
411
  className: "flex items-center gap-1 px-3 py-1.5 text-sm border border-border-subtle rounded-lg hover:bg-bg-sunken transition-colors disabled:opacity-40 disabled:cursor-not-allowed",
437
- children: [/* @__PURE__ */ S(te, { size: 16 }), T("channel.previous", "Previous")]
412
+ children: [/* @__PURE__ */ S(ee, { size: 16 }), E("channel.previous", "Previous")]
438
413
  }), /* @__PURE__ */ C("button", {
439
414
  type: "button",
440
- onClick: () => void ie(),
441
- disabled: !oe || k,
415
+ onClick: () => void ae(),
416
+ disabled: !se || A,
442
417
  className: "flex items-center gap-1 px-3 py-1.5 text-sm border border-border-subtle rounded-lg hover:bg-bg-sunken transition-colors disabled:opacity-40 disabled:cursor-not-allowed",
443
- children: [T("channel.next", "Next"), /* @__PURE__ */ S(ne, { size: 16 })]
418
+ children: [E("channel.next", "Next"), /* @__PURE__ */ S(p, { size: 16 })]
444
419
  })]
445
420
  })]
446
421
  })
@@ -449,6 +424,6 @@ function T() {
449
424
  });
450
425
  }
451
426
  //#endregion
452
- export { T as DeliveryHistoryPage };
427
+ export { E as DeliveryHistoryPage };
453
428
 
454
429
  //# sourceMappingURL=DeliveryHistoryPage.js.map