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