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