@burdenoff/microfe-channel 2026.625.1 → 2026.625.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.
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.js +73 -76
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.js +407 -353
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js +93 -87
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js +119 -96
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelsListPage.js +219 -196
- package/dist/channel/modules/channels/pages/ChannelsListPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +277 -232
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js +112 -91
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateChannelPage.js +28 -22
- package/dist/channel/modules/channels/pages/CreateChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateConnectionPage.js +72 -65
- package/dist/channel/modules/channels/pages/CreateConnectionPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js +101 -93
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.js +154 -148
- package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditConnectionPage.js +69 -62
- package/dist/channel/modules/channels/pages/EditConnectionPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.js +131 -124
- package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js +152 -129
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,67 +3,67 @@ import { getGlobalChannelClient as t } from "../../../graphql/global-client.js";
|
|
|
3
3
|
import { useSendNotificationMutation as n } from "../../../../generated/global-operations.js";
|
|
4
4
|
import { useChannels as r } from "../../../hooks/useChannels.js";
|
|
5
5
|
import { PermissionGuard as i } from "../../../components/PermissionGuard.js";
|
|
6
|
-
import { CHANNEL_PERMISSIONS as
|
|
7
|
-
import { NotificationChannel as
|
|
8
|
-
import { useCallback as
|
|
9
|
-
import { useI18n as
|
|
10
|
-
import { AlertCircle as
|
|
6
|
+
import { CHANNEL_PERMISSIONS as ee } from "../../../constants/permissions.js";
|
|
7
|
+
import { NotificationChannel as a, NotificationPriority as o } from "../../../../generated/global-types.js";
|
|
8
|
+
import { useCallback as s, useRef as c, useState as l } from "react";
|
|
9
|
+
import { useI18n as u } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
|
+
import { AlertCircle as d, ArrowLeft as f, Bell as p, CheckCircle2 as m, Hash as h, Loader2 as g, Mail as _, MessageCircle as v, MessageSquare as y, Plus as b, Send as x, Smartphone as S, Users as C, X as te, XCircle as ne } from "lucide-react";
|
|
11
11
|
import { useNavigate as re } from "react-router-dom";
|
|
12
12
|
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
13
|
-
import { EmphasisPanel as
|
|
13
|
+
import { EmphasisPanel as D, GlassCard as O, IllustratedEmptyState as k, PagePurpose as ie } from "@burdenoff/fe-libs/ui";
|
|
14
14
|
//#region src/channel/modules/channels/pages/SendMessagePage.tsx
|
|
15
|
-
var
|
|
15
|
+
var ae = {
|
|
16
16
|
EMAIL: _,
|
|
17
|
-
SMS:
|
|
18
|
-
PUSH:
|
|
17
|
+
SMS: S,
|
|
18
|
+
PUSH: p,
|
|
19
19
|
WHATSAPP: y,
|
|
20
|
-
SLACK:
|
|
21
|
-
TEAMS:
|
|
20
|
+
SLACK: h,
|
|
21
|
+
TEAMS: C,
|
|
22
22
|
DISCORD: v,
|
|
23
|
-
INAPP:
|
|
23
|
+
INAPP: p,
|
|
24
24
|
WEBCHAT: y,
|
|
25
|
-
WEBHOOK:
|
|
25
|
+
WEBHOOK: x
|
|
26
26
|
};
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
let n =
|
|
27
|
+
function A() {
|
|
28
|
+
let p = re(), { channels: h } = r(), { organizationId: _, authToken: v, apiGatewayUrl: y } = e(), { t: S } = u(), C = (e, t) => {
|
|
29
|
+
let n = S(e);
|
|
30
30
|
return n === e ? t : n;
|
|
31
|
-
}, [
|
|
32
|
-
if (!
|
|
31
|
+
}, [A, { loading: j }] = n({ client: t(y, v, _) }), [M, N] = l(""), [P, F] = l("EMAIL"), [I, L] = l([]), oe = c(0), [R, z] = l(""), [B, V] = l(""), [H, U] = l(""), [W, G] = l(""), [K, se] = l(o.Medium), [q, J] = l(null), [Y, X] = l(null), Z = h.filter((e) => e.platform === P), ce = s(() => {
|
|
32
|
+
if (!R.trim()) return;
|
|
33
33
|
let e = {
|
|
34
|
-
id: `r-${++
|
|
35
|
-
address:
|
|
36
|
-
name:
|
|
34
|
+
id: `r-${++oe.current}`,
|
|
35
|
+
address: R.trim(),
|
|
36
|
+
name: B.trim() || void 0
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
}, []),
|
|
42
|
-
J(null), X(null),
|
|
43
|
-
}, []),
|
|
44
|
-
if (!
|
|
45
|
-
X(
|
|
38
|
+
L((t) => [...t, e]), z(""), V("");
|
|
39
|
+
}, [R, B]), le = s((e) => {
|
|
40
|
+
L((t) => t.filter((t) => t.id !== e));
|
|
41
|
+
}, []), ue = s(() => {
|
|
42
|
+
J(null), X(null), U(""), G(""), L([]);
|
|
43
|
+
}, []), de = async () => {
|
|
44
|
+
if (!M) {
|
|
45
|
+
X(C("channel.validation.selectChannel", "Please select a channel"));
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
if (
|
|
49
|
-
X(
|
|
48
|
+
if (I.length === 0) {
|
|
49
|
+
X(C("channel.validation.addRecipient", "Please add at least one recipient"));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
if (!
|
|
53
|
-
X(
|
|
52
|
+
if (!W.trim()) {
|
|
53
|
+
X(C("channel.validation.enterMessage", "Please enter a message"));
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
X(null), J(null);
|
|
57
57
|
try {
|
|
58
|
-
let e =
|
|
58
|
+
let e = h.find((e) => e.id === M);
|
|
59
59
|
if (!e) {
|
|
60
|
-
X(
|
|
60
|
+
X(C("channel.error.channelNotFound", "Selected channel not found"));
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
let t =
|
|
64
|
-
J(await Promise.all(
|
|
63
|
+
let t = P === "INAPP" ? a.InApp : P;
|
|
64
|
+
J(await Promise.all(I.map(async (n) => {
|
|
65
65
|
let r = {};
|
|
66
|
-
switch (
|
|
66
|
+
switch (P) {
|
|
67
67
|
case "EMAIL":
|
|
68
68
|
r.email = n.address;
|
|
69
69
|
break;
|
|
@@ -89,15 +89,15 @@ function k() {
|
|
|
89
89
|
channelId: e.id,
|
|
90
90
|
platform: t,
|
|
91
91
|
notification: {
|
|
92
|
-
body:
|
|
92
|
+
body: W,
|
|
93
93
|
channel: t,
|
|
94
94
|
recipient: r,
|
|
95
|
-
subject:
|
|
96
|
-
priority:
|
|
95
|
+
subject: P === "EMAIL" ? H : void 0,
|
|
96
|
+
priority: K
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
try {
|
|
100
|
-
let e = await
|
|
100
|
+
let e = await A({ variables: { input: i } });
|
|
101
101
|
if (e.data?.triggerNotification) {
|
|
102
102
|
let t = e.data.triggerNotification, r = t.status === "FAILED" || t.triggerStatus === "FAILED", i = t.errorMessage || t.errorCode;
|
|
103
103
|
return {
|
|
@@ -125,7 +125,7 @@ function k() {
|
|
|
125
125
|
}
|
|
126
126
|
}, Q = q?.filter((e) => e.success).length ?? 0, $ = q?.filter((e) => !e.success).length ?? 0;
|
|
127
127
|
return /* @__PURE__ */ T(i, {
|
|
128
|
-
permission:
|
|
128
|
+
permission: ee.CHANNEL_DELIVERY_SEND,
|
|
129
129
|
children: /* @__PURE__ */ E("div", {
|
|
130
130
|
className: "min-h-screen bg-bg-surface",
|
|
131
131
|
children: [/* @__PURE__ */ T("div", {
|
|
@@ -136,26 +136,32 @@ function k() {
|
|
|
136
136
|
className: "flex items-center gap-4",
|
|
137
137
|
children: [/* @__PURE__ */ T("button", {
|
|
138
138
|
type: "button",
|
|
139
|
-
onClick: () =>
|
|
139
|
+
onClick: () => p("/channels/list"),
|
|
140
140
|
className: "p-2 hover:bg-bg-sunken rounded-lg transition-colors",
|
|
141
|
-
children: /* @__PURE__ */ T(
|
|
141
|
+
children: /* @__PURE__ */ T(f, { className: "size-5 " })
|
|
142
142
|
}), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h1", {
|
|
143
143
|
className: "text-2xl font-bold",
|
|
144
|
-
children:
|
|
144
|
+
children: C("channel.sendMessage", "Send Message")
|
|
145
145
|
}), /* @__PURE__ */ T("p", {
|
|
146
146
|
className: "text-sm text-text-secondary",
|
|
147
|
-
children:
|
|
147
|
+
children: C("channel.sendMessageSubtitle", "Send notifications through configured channels")
|
|
148
148
|
})] })]
|
|
149
149
|
})
|
|
150
150
|
})
|
|
151
|
-
}), /* @__PURE__ */
|
|
152
|
-
className: "container mx-auto px-6 py-8 max-w-3xl",
|
|
153
|
-
children:
|
|
151
|
+
}), /* @__PURE__ */ E("div", {
|
|
152
|
+
className: "container mx-auto px-6 py-8 max-w-3xl space-y-6",
|
|
153
|
+
children: [/* @__PURE__ */ T(ie, {
|
|
154
|
+
icon: /* @__PURE__ */ T(x, {
|
|
155
|
+
size: 15,
|
|
156
|
+
"aria-hidden": "true"
|
|
157
|
+
}),
|
|
158
|
+
children: C("channel.sendMessagePurpose", "Compose and fire off a one-off notification through any configured channel — handy for testing a freshly set-up channel, sending a quick announcement, or reproducing a delivery problem. Pick the platform and channel, add one or more recipients, write your message, and send; you will get a per-recipient success/failure breakdown so you know exactly what got through.")
|
|
159
|
+
}), q === null ? /* @__PURE__ */ E("div", {
|
|
154
160
|
className: "space-y-6",
|
|
155
161
|
children: [
|
|
156
162
|
Y && /* @__PURE__ */ E("div", {
|
|
157
163
|
className: "p-4 rounded-lg bg-status-error-bg/10 border border-status-error-border/20 flex items-center gap-3",
|
|
158
|
-
children: [/* @__PURE__ */ T(
|
|
164
|
+
children: [/* @__PURE__ */ T(d, { className: "size-5 text-status-error-text shrink-0" }), /* @__PURE__ */ T("p", {
|
|
159
165
|
className: "text-sm text-status-error-text",
|
|
160
166
|
children: Y
|
|
161
167
|
})]
|
|
@@ -164,7 +170,7 @@ function k() {
|
|
|
164
170
|
className: "space-y-3",
|
|
165
171
|
children: [/* @__PURE__ */ T("label", {
|
|
166
172
|
className: "text-sm font-medium",
|
|
167
|
-
children:
|
|
173
|
+
children: C("channel.platform", "Platform")
|
|
168
174
|
}), /* @__PURE__ */ T("div", {
|
|
169
175
|
className: "flex flex-wrap gap-2",
|
|
170
176
|
children: [
|
|
@@ -176,13 +182,13 @@ function k() {
|
|
|
176
182
|
"TEAMS",
|
|
177
183
|
"WEBHOOK"
|
|
178
184
|
].map((e) => {
|
|
179
|
-
let t =
|
|
185
|
+
let t = ae[e] || x;
|
|
180
186
|
return /* @__PURE__ */ E("button", {
|
|
181
187
|
type: "button",
|
|
182
188
|
onClick: () => {
|
|
183
|
-
|
|
189
|
+
F(e), N("");
|
|
184
190
|
},
|
|
185
|
-
className: `px-4 py-2 rounded-lg border flex items-center gap-2 transition-all ${
|
|
191
|
+
className: `px-4 py-2 rounded-lg border flex items-center gap-2 transition-all ${P === e ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface hover:bg-bg-sunken border-border-subtle"}`,
|
|
186
192
|
children: [/* @__PURE__ */ T(t, { className: "size-4 " }), /* @__PURE__ */ T("span", {
|
|
187
193
|
className: "text-sm",
|
|
188
194
|
children: e
|
|
@@ -195,30 +201,30 @@ function k() {
|
|
|
195
201
|
className: "space-y-2",
|
|
196
202
|
children: [/* @__PURE__ */ E("label", {
|
|
197
203
|
className: "text-sm font-medium",
|
|
198
|
-
children: [
|
|
204
|
+
children: [C("channel.channel", "Channel"), " *"]
|
|
199
205
|
}), Z.length === 0 ? /* @__PURE__ */ T("div", {
|
|
200
|
-
className: "
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
className: "
|
|
211
|
-
|
|
212
|
-
})
|
|
213
|
-
|
|
206
|
+
className: "rounded-lg border border-dashed",
|
|
207
|
+
children: /* @__PURE__ */ T(k, {
|
|
208
|
+
illustration: "empty-data",
|
|
209
|
+
title: C("channel.noPlatformChannels", `No ${P} channels configured`),
|
|
210
|
+
description: C("channel.noPlatformChannelsHint", "Create a channel for this platform to be able to send through it."),
|
|
211
|
+
action: /* @__PURE__ */ E("button", {
|
|
212
|
+
type: "button",
|
|
213
|
+
onClick: () => p("./create"),
|
|
214
|
+
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
215
|
+
children: [/* @__PURE__ */ T(b, {
|
|
216
|
+
className: "size-4",
|
|
217
|
+
"aria-hidden": "true"
|
|
218
|
+
}), C("channel.createChannel", "Create Channel")]
|
|
219
|
+
})
|
|
214
220
|
})
|
|
215
221
|
}) : /* @__PURE__ */ E("select", {
|
|
216
|
-
value:
|
|
217
|
-
onChange: (e) =>
|
|
222
|
+
value: M,
|
|
223
|
+
onChange: (e) => N(e.target.value),
|
|
218
224
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
219
225
|
children: [/* @__PURE__ */ T("option", {
|
|
220
226
|
value: "",
|
|
221
|
-
children:
|
|
227
|
+
children: C("channel.selectChannel", "Select a channel...")
|
|
222
228
|
}), Z.map((e) => /* @__PURE__ */ E("option", {
|
|
223
229
|
value: e.id,
|
|
224
230
|
children: [
|
|
@@ -235,40 +241,40 @@ function k() {
|
|
|
235
241
|
children: [
|
|
236
242
|
/* @__PURE__ */ T("label", {
|
|
237
243
|
className: "text-sm font-medium",
|
|
238
|
-
children:
|
|
244
|
+
children: C("channel.recipients", "Recipients")
|
|
239
245
|
}),
|
|
240
246
|
/* @__PURE__ */ E("div", {
|
|
241
247
|
className: "flex gap-2",
|
|
242
248
|
children: [
|
|
243
249
|
/* @__PURE__ */ T("input", {
|
|
244
|
-
"aria-label":
|
|
250
|
+
"aria-label": P === "EMAIL" ? "email@example.com" : "+1234567890",
|
|
245
251
|
type: "text",
|
|
246
|
-
value:
|
|
247
|
-
onChange: (e) =>
|
|
248
|
-
placeholder:
|
|
252
|
+
value: R,
|
|
253
|
+
onChange: (e) => z(e.target.value),
|
|
254
|
+
placeholder: P === "EMAIL" ? "email@example.com" : "+1234567890",
|
|
249
255
|
className: "flex-1 px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary"
|
|
250
256
|
}),
|
|
251
257
|
/* @__PURE__ */ T("input", {
|
|
252
|
-
"aria-label":
|
|
258
|
+
"aria-label": C("channel.nameOptional", "Name (optional)"),
|
|
253
259
|
type: "text",
|
|
254
|
-
value:
|
|
255
|
-
onChange: (e) =>
|
|
256
|
-
placeholder:
|
|
260
|
+
value: B,
|
|
261
|
+
onChange: (e) => V(e.target.value),
|
|
262
|
+
placeholder: C("channel.nameOptional", "Name (optional)"),
|
|
257
263
|
className: "w-full sm:w-48 px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary"
|
|
258
264
|
}),
|
|
259
265
|
/* @__PURE__ */ E("button", {
|
|
260
266
|
type: "button",
|
|
261
|
-
onClick:
|
|
262
|
-
disabled: !
|
|
267
|
+
onClick: ce,
|
|
268
|
+
disabled: !R.trim(),
|
|
263
269
|
className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 flex items-center gap-2",
|
|
264
|
-
children: [/* @__PURE__ */ T(
|
|
270
|
+
children: [/* @__PURE__ */ T(b, { className: "size-4 " }), C("channel.add", "Add")]
|
|
265
271
|
})
|
|
266
272
|
]
|
|
267
273
|
}),
|
|
268
|
-
|
|
274
|
+
I.length > 0 ? /* @__PURE__ */ T(O, {
|
|
269
275
|
treatment: "plain",
|
|
270
276
|
className: "border-border-seam rounded-lg p-0 divide-y divide-[var(--color-border-seam)] overflow-hidden",
|
|
271
|
-
children:
|
|
277
|
+
children: I.map((e) => /* @__PURE__ */ E("div", {
|
|
272
278
|
className: "p-3 flex items-center justify-between",
|
|
273
279
|
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
274
280
|
className: "text-sm font-medium",
|
|
@@ -278,14 +284,15 @@ function k() {
|
|
|
278
284
|
children: e.name
|
|
279
285
|
})] }), /* @__PURE__ */ T("button", {
|
|
280
286
|
type: "button",
|
|
281
|
-
onClick: () =>
|
|
287
|
+
onClick: () => le(e.id),
|
|
282
288
|
className: "p-1 hover:bg-bg-sunken rounded transition-colors",
|
|
283
|
-
children: /* @__PURE__ */ T(
|
|
289
|
+
children: /* @__PURE__ */ T(te, { className: "size-4 text-text-secondary" })
|
|
284
290
|
})]
|
|
285
291
|
}, e.id))
|
|
286
|
-
}) : /* @__PURE__ */ T(
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
}) : /* @__PURE__ */ T(k, {
|
|
293
|
+
illustration: "empty-people",
|
|
294
|
+
title: C("channel.noRecipientsYet", "No recipients added yet"),
|
|
295
|
+
description: C("channel.addRecipientsHint", "Add one or more recipients above to send this message to.")
|
|
289
296
|
})
|
|
290
297
|
]
|
|
291
298
|
}),
|
|
@@ -294,20 +301,20 @@ function k() {
|
|
|
294
301
|
children: [
|
|
295
302
|
/* @__PURE__ */ E("label", {
|
|
296
303
|
className: "text-sm font-medium",
|
|
297
|
-
children: [
|
|
304
|
+
children: [C("channel.messageContent", "Message Content"), " *"]
|
|
298
305
|
}),
|
|
299
|
-
|
|
306
|
+
P === "EMAIL" && /* @__PURE__ */ T("input", {
|
|
300
307
|
"aria-label": "Subject",
|
|
301
308
|
type: "text",
|
|
302
|
-
value:
|
|
303
|
-
onChange: (e) =>
|
|
309
|
+
value: H,
|
|
310
|
+
onChange: (e) => U(e.target.value),
|
|
304
311
|
placeholder: "Subject",
|
|
305
312
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary"
|
|
306
313
|
}),
|
|
307
314
|
/* @__PURE__ */ T("textarea", {
|
|
308
315
|
"aria-label": "Enter your message...",
|
|
309
|
-
value:
|
|
310
|
-
onChange: (e) =>
|
|
316
|
+
value: W,
|
|
317
|
+
onChange: (e) => G(e.target.value),
|
|
311
318
|
placeholder: "Enter your message...",
|
|
312
319
|
rows: 6,
|
|
313
320
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary resize-none"
|
|
@@ -318,18 +325,18 @@ function k() {
|
|
|
318
325
|
className: "space-y-2",
|
|
319
326
|
children: [/* @__PURE__ */ T("label", {
|
|
320
327
|
className: "text-sm font-medium",
|
|
321
|
-
children:
|
|
328
|
+
children: C("channel.priority", "Priority")
|
|
322
329
|
}), /* @__PURE__ */ T("div", {
|
|
323
330
|
className: "flex gap-2",
|
|
324
331
|
children: [
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
332
|
+
o.Low,
|
|
333
|
+
o.Medium,
|
|
334
|
+
o.High,
|
|
335
|
+
o.Urgent
|
|
329
336
|
].map((e) => /* @__PURE__ */ T("button", {
|
|
330
337
|
type: "button",
|
|
331
|
-
onClick: () =>
|
|
332
|
-
className: `px-4 py-2 rounded-lg border text-sm transition-all ${
|
|
338
|
+
onClick: () => se(e),
|
|
339
|
+
className: `px-4 py-2 rounded-lg border text-sm transition-all ${K === e ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface hover:bg-bg-sunken border-border-subtle"}`,
|
|
333
340
|
children: e
|
|
334
341
|
}, e))
|
|
335
342
|
})]
|
|
@@ -338,52 +345,52 @@ function k() {
|
|
|
338
345
|
className: "flex justify-end pt-4",
|
|
339
346
|
children: /* @__PURE__ */ T("button", {
|
|
340
347
|
type: "button",
|
|
341
|
-
onClick:
|
|
342
|
-
disabled:
|
|
348
|
+
onClick: de,
|
|
349
|
+
disabled: j || !M || I.length === 0 || !W.trim(),
|
|
343
350
|
className: "px-6 py-3 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 flex items-center gap-2",
|
|
344
|
-
children:
|
|
345
|
-
/* @__PURE__ */ T(
|
|
346
|
-
|
|
351
|
+
children: j ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(g, { className: "size-5 animate-spin" }), C("channel.sending", "Sending...")] }) : /* @__PURE__ */ E(w, { children: [
|
|
352
|
+
/* @__PURE__ */ T(x, { className: "size-5 " }),
|
|
353
|
+
C("channel.sendTo", "Send to"),
|
|
347
354
|
" ",
|
|
348
|
-
|
|
355
|
+
I.length,
|
|
349
356
|
" ",
|
|
350
|
-
|
|
357
|
+
I.length === 1 ? C("channel.recipient", "recipient") : C("channel.recipients", "recipients")
|
|
351
358
|
] })
|
|
352
359
|
})
|
|
353
360
|
})
|
|
354
361
|
]
|
|
355
362
|
}) : /* @__PURE__ */ E("div", {
|
|
356
363
|
className: "space-y-6",
|
|
357
|
-
children: [/* @__PURE__ */ E(
|
|
364
|
+
children: [/* @__PURE__ */ E(D, {
|
|
358
365
|
className: "p-4 flex items-center justify-between",
|
|
359
366
|
children: [/* @__PURE__ */ E("div", {
|
|
360
367
|
className: "flex items-center gap-4",
|
|
361
|
-
children: [$ === 0 ? /* @__PURE__ */ T(
|
|
368
|
+
children: [$ === 0 ? /* @__PURE__ */ T(m, { className: "size-8 text-status-success-text" }) : /* @__PURE__ */ T(d, { className: "size-8 text-status-warning-text" }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
|
|
362
369
|
className: "text-lg font-semibold",
|
|
363
|
-
children: $ === 0 ?
|
|
370
|
+
children: $ === 0 ? C("channel.allMessagesSent", "All messages sent!") : `${Q} of ${I.length} sent`
|
|
364
371
|
}), /* @__PURE__ */ E("p", {
|
|
365
372
|
className: "text-sm text-text-secondary",
|
|
366
373
|
children: [
|
|
367
374
|
Q,
|
|
368
375
|
" ",
|
|
369
|
-
|
|
376
|
+
C("channel.successful", "successful"),
|
|
370
377
|
", ",
|
|
371
378
|
$,
|
|
372
379
|
" ",
|
|
373
|
-
|
|
380
|
+
C("channel.failed", "failed")
|
|
374
381
|
]
|
|
375
382
|
})] })]
|
|
376
383
|
}), /* @__PURE__ */ T("button", {
|
|
377
384
|
type: "button",
|
|
378
|
-
onClick:
|
|
385
|
+
onClick: ue,
|
|
379
386
|
className: "px-4 py-2 rounded-lg border hover:bg-bg-sunken transition-colors",
|
|
380
|
-
children:
|
|
387
|
+
children: C("channel.sendAnother", "Send Another")
|
|
381
388
|
})]
|
|
382
|
-
}), /* @__PURE__ */ T(
|
|
389
|
+
}), /* @__PURE__ */ T(O, {
|
|
383
390
|
treatment: "plain",
|
|
384
391
|
className: "border-border-seam rounded-lg p-0 divide-y divide-[var(--color-border-seam)] overflow-hidden",
|
|
385
392
|
children: q.map((e) => {
|
|
386
|
-
let t =
|
|
393
|
+
let t = I.find((t) => t.id === e.recipientId);
|
|
387
394
|
return /* @__PURE__ */ E("div", {
|
|
388
395
|
className: "p-4 flex items-center justify-between",
|
|
389
396
|
children: [/* @__PURE__ */ E("div", { children: [
|
|
@@ -403,16 +410,16 @@ function k() {
|
|
|
403
410
|
className: "text-xs text-status-error-text",
|
|
404
411
|
children: e.error
|
|
405
412
|
})
|
|
406
|
-
] }), e.success ? /* @__PURE__ */ T(
|
|
413
|
+
] }), e.success ? /* @__PURE__ */ T(m, { className: "size-5 text-status-success-text" }) : /* @__PURE__ */ T(ne, { className: "size-5 text-status-error-text" })]
|
|
407
414
|
}, e.recipientId);
|
|
408
415
|
})
|
|
409
416
|
})]
|
|
410
|
-
})
|
|
417
|
+
})]
|
|
411
418
|
})]
|
|
412
419
|
})
|
|
413
420
|
});
|
|
414
421
|
}
|
|
415
422
|
//#endregion
|
|
416
|
-
export {
|
|
423
|
+
export { A as SendMessagePage };
|
|
417
424
|
|
|
418
425
|
//# sourceMappingURL=SendMessagePage.js.map
|