@burdenoff/microfe-channel 2026.625.2 → 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 +19 -12
- 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 +154 -134
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelsListPage.js +279 -244
- 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 +159 -129
- 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 +99 -79
- 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 +174 -154
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,19 +2,19 @@ import { nativeImpact as e, nativeNotify as t } from "../../../../utils/nativeBr
|
|
|
2
2
|
import { useChannel as n, useChannels as r } from "../../../hooks/useChannels.js";
|
|
3
3
|
import { PermissionGuard as i } from "../../../components/PermissionGuard.js";
|
|
4
4
|
import { CHANNEL_PERMISSIONS as a } from "../../../constants/permissions.js";
|
|
5
|
-
import { useEffect as o, useRef as
|
|
6
|
-
import { useI18n as
|
|
7
|
-
import { AlertCircle as
|
|
8
|
-
import { useNavigate as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { GlassCard as k } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
import { useEffect as o, useRef as ee, useState as s } from "react";
|
|
6
|
+
import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
import { AlertCircle as l, ArrowLeft as u, Bell as d, Hash as f, Inbox as p, Loader2 as m, Mail as h, MessageCircle as g, MessageSquare as _, Save as v, Send as y, Smartphone as b, Trash2 as x, Users as S } from "lucide-react";
|
|
8
|
+
import { useNavigate as C, useParams as w } from "react-router-dom";
|
|
9
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
10
|
+
import { EmphasisPanel as O, GlassCard as k, PagePurpose as A } from "@burdenoff/fe-libs/ui";
|
|
11
11
|
//#region src/channel/modules/channels/pages/EditChannelPage.tsx
|
|
12
|
-
var
|
|
12
|
+
var j = [
|
|
13
13
|
{
|
|
14
14
|
value: "EMAIL",
|
|
15
15
|
label: "Email",
|
|
16
16
|
description: "Send emails via various providers",
|
|
17
|
-
icon:
|
|
17
|
+
icon: h,
|
|
18
18
|
color: "text-status-info-text bg-status-info-bg-subtle border-status-info-border",
|
|
19
19
|
adapters: [
|
|
20
20
|
{
|
|
@@ -51,7 +51,7 @@ var A = [
|
|
|
51
51
|
value: "SMS",
|
|
52
52
|
label: "SMS",
|
|
53
53
|
description: "Send text messages",
|
|
54
|
-
icon:
|
|
54
|
+
icon: b,
|
|
55
55
|
color: "text-status-success-text bg-status-success-bg-subtle border-status-success-border/30",
|
|
56
56
|
adapters: [
|
|
57
57
|
{
|
|
@@ -84,7 +84,7 @@ var A = [
|
|
|
84
84
|
value: "PUSH",
|
|
85
85
|
label: "Push",
|
|
86
86
|
description: "Mobile & web push",
|
|
87
|
-
icon:
|
|
87
|
+
icon: d,
|
|
88
88
|
color: "text-accent-purple bg-accent-purple-subtle border-accent-purple/30",
|
|
89
89
|
adapters: [
|
|
90
90
|
{
|
|
@@ -109,7 +109,7 @@ var A = [
|
|
|
109
109
|
value: "INAPP",
|
|
110
110
|
label: "In-App",
|
|
111
111
|
description: "Internal in-app notifications",
|
|
112
|
-
icon:
|
|
112
|
+
icon: p,
|
|
113
113
|
color: "text-status-warning-text bg-status-warning-bg-subtle border-status-warning-border/30",
|
|
114
114
|
adapters: [{
|
|
115
115
|
value: "INAPP_NATIVE",
|
|
@@ -120,7 +120,7 @@ var A = [
|
|
|
120
120
|
value: "WHATSAPP",
|
|
121
121
|
label: "WhatsApp",
|
|
122
122
|
description: "WhatsApp Business messaging",
|
|
123
|
-
icon:
|
|
123
|
+
icon: _,
|
|
124
124
|
color: "text-status-success-text bg-status-success-bg-subtle border-status-success-border/30",
|
|
125
125
|
adapters: [{
|
|
126
126
|
value: "WHATSAPP_CLOUD",
|
|
@@ -134,7 +134,7 @@ var A = [
|
|
|
134
134
|
value: "SLACK",
|
|
135
135
|
label: "Slack",
|
|
136
136
|
description: "Slack bot & channels",
|
|
137
|
-
icon:
|
|
137
|
+
icon: f,
|
|
138
138
|
color: "text-accent-purple bg-accent-purple-subtle border-accent-purple/30",
|
|
139
139
|
adapters: [{
|
|
140
140
|
value: "SLACK_BOT",
|
|
@@ -145,7 +145,7 @@ var A = [
|
|
|
145
145
|
value: "TEAMS",
|
|
146
146
|
label: "Teams",
|
|
147
147
|
description: "Microsoft Teams",
|
|
148
|
-
icon:
|
|
148
|
+
icon: S,
|
|
149
149
|
color: "text-status-info-text bg-status-info-bg-subtle border-status-info-border",
|
|
150
150
|
adapters: [{
|
|
151
151
|
value: "TEAMS_BOT",
|
|
@@ -156,7 +156,7 @@ var A = [
|
|
|
156
156
|
value: "DISCORD",
|
|
157
157
|
label: "Discord",
|
|
158
158
|
description: "Discord bots & webhooks",
|
|
159
|
-
icon:
|
|
159
|
+
icon: g,
|
|
160
160
|
color: "text-accent-indigo bg-accent-indigo-subtle border-accent-indigo/30",
|
|
161
161
|
adapters: [{
|
|
162
162
|
value: "DISCORD_BOT",
|
|
@@ -167,7 +167,7 @@ var A = [
|
|
|
167
167
|
value: "WEBCHAT",
|
|
168
168
|
label: "Webchat",
|
|
169
169
|
description: "Website live chat",
|
|
170
|
-
icon:
|
|
170
|
+
icon: _,
|
|
171
171
|
color: "text-accent-teal bg-accent-teal-subtle border-accent-teal/30",
|
|
172
172
|
adapters: [{
|
|
173
173
|
value: "WEBCHAT_NATIVE",
|
|
@@ -178,14 +178,14 @@ var A = [
|
|
|
178
178
|
value: "WEBHOOK",
|
|
179
179
|
label: "Webhook",
|
|
180
180
|
description: "Generic HTTP webhook",
|
|
181
|
-
icon:
|
|
181
|
+
icon: y,
|
|
182
182
|
color: "text-text-secondary bg-bg-sunken/50 border-border-subtle",
|
|
183
183
|
adapters: [{
|
|
184
184
|
value: "WEBHOOK_HTTP",
|
|
185
185
|
label: "HTTP Webhook"
|
|
186
186
|
}]
|
|
187
187
|
}
|
|
188
|
-
],
|
|
188
|
+
], M = [
|
|
189
189
|
{
|
|
190
190
|
value: 0,
|
|
191
191
|
label: "0 - Lowest"
|
|
@@ -207,179 +207,185 @@ var A = [
|
|
|
207
207
|
label: "4 - Highest"
|
|
208
208
|
}
|
|
209
209
|
];
|
|
210
|
-
function
|
|
211
|
-
let
|
|
212
|
-
let n =
|
|
210
|
+
function N() {
|
|
211
|
+
let d = C(), { channelId: f } = w(), { channel: p, isLoading: h, error: g } = n(f), { updateChannel: _, deleteChannel: y } = r(), { t: b } = c(), S = (e, t) => {
|
|
212
|
+
let n = b(e);
|
|
213
213
|
return n === e ? t : n;
|
|
214
|
-
}, [
|
|
214
|
+
}, [N, P] = s(""), [F, I] = s(""), [L, R] = s("AWS_SES"), [z, B] = s(2), [V, H] = s("INACTIVE"), [U, W] = s(!1), [G, K] = s(!1), [q, J] = s(null), [Y, X] = s(!1), Z = ee(null);
|
|
215
215
|
o(() => {
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
p && p.id !== Z.current && (Z.current = p.id, Promise.resolve().then(() => {
|
|
217
|
+
P(p.name || ""), I(p.description || ""), R(p.adapterType || "AWS_SES"), B(p.priority || 2), H(p.status || "INACTIVE");
|
|
218
218
|
}));
|
|
219
|
-
}, [
|
|
220
|
-
let
|
|
221
|
-
return
|
|
219
|
+
}, [p]);
|
|
220
|
+
let Q = p?.platform || "EMAIL", $ = j.find((e) => e.value === Q);
|
|
221
|
+
return h ? /* @__PURE__ */ E("div", {
|
|
222
222
|
className: "flex items-center justify-center min-h-screen",
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
-
}) :
|
|
223
|
+
children: /* @__PURE__ */ E(m, { className: "size-8 animate-spin text-text-secondary" })
|
|
224
|
+
}) : g || !p ? /* @__PURE__ */ D("div", {
|
|
225
225
|
className: "flex flex-col items-center justify-center min-h-screen gap-4",
|
|
226
226
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ E(l, { className: "size-12 text-status-error-text" }),
|
|
228
|
+
/* @__PURE__ */ E("h1", {
|
|
229
229
|
className: "text-xl font-semibold",
|
|
230
|
-
children:
|
|
230
|
+
children: S("channel.channelNotFound", "Channel not found")
|
|
231
231
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ E("button", {
|
|
233
233
|
type: "button",
|
|
234
|
-
onClick: () =>
|
|
234
|
+
onClick: () => d("../list"),
|
|
235
235
|
className: "text-primary hover:underline",
|
|
236
|
-
children:
|
|
236
|
+
children: S("channel.backToChannels", "Back to channels")
|
|
237
237
|
})
|
|
238
238
|
]
|
|
239
|
-
}) : /* @__PURE__ */
|
|
239
|
+
}) : /* @__PURE__ */ E(i, {
|
|
240
240
|
permission: a.CHANNEL_UPDATE,
|
|
241
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ D("div", {
|
|
242
242
|
className: "min-h-screen bg-bg-surface",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ E("div", {
|
|
244
244
|
className: "border-b bg-bg-surface",
|
|
245
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ E("div", {
|
|
246
246
|
className: "container mx-auto px-6 py-4",
|
|
247
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ D("div", {
|
|
248
248
|
className: "flex items-center gap-4",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
249
|
+
children: [/* @__PURE__ */ E("button", {
|
|
250
250
|
type: "button",
|
|
251
|
-
onClick: () =>
|
|
251
|
+
onClick: () => d(`/channels/${f}`),
|
|
252
252
|
className: "p-2 hover:bg-bg-sunken rounded-lg transition-colors",
|
|
253
|
-
children: /* @__PURE__ */
|
|
254
|
-
}), /* @__PURE__ */
|
|
253
|
+
children: /* @__PURE__ */ E(u, { className: "size-5 " })
|
|
254
|
+
}), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h1", {
|
|
255
255
|
className: "text-2xl font-bold",
|
|
256
|
-
children:
|
|
257
|
-
}), /* @__PURE__ */
|
|
256
|
+
children: S("channel.editChannel", "Edit Channel")
|
|
257
|
+
}), /* @__PURE__ */ E("p", {
|
|
258
258
|
className: "text-sm text-text-secondary",
|
|
259
|
-
children:
|
|
259
|
+
children: S("channel.updateChannelConfig", "Update channel configuration")
|
|
260
260
|
})] })]
|
|
261
261
|
})
|
|
262
262
|
})
|
|
263
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ E("div", {
|
|
264
264
|
className: "container mx-auto px-6 py-8 max-w-2xl",
|
|
265
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ D("div", {
|
|
266
266
|
className: "space-y-6",
|
|
267
267
|
children: [
|
|
268
|
-
|
|
268
|
+
/* @__PURE__ */ E(A, {
|
|
269
|
+
icon: /* @__PURE__ */ E(v, {
|
|
270
|
+
size: 15,
|
|
271
|
+
"aria-hidden": "true"
|
|
272
|
+
}),
|
|
273
|
+
children: S("channel.editChannelPurpose", "Change how this channel behaves — its name, description, priority and status. The platform and provider stay fixed (they define what the channel is); to swap credentials use the channel's connection instead. Use this to rename a channel, bump its priority, or temporarily deactivate it without deleting it.")
|
|
274
|
+
}),
|
|
275
|
+
q && /* @__PURE__ */ D("div", {
|
|
269
276
|
className: "p-4 rounded-lg bg-status-error-bg/10 border border-status-error-border/20 flex items-center gap-3",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ E(l, { className: "size-5 text-status-error-text shrink-0" }), /* @__PURE__ */ E("p", {
|
|
271
278
|
className: "text-sm text-status-error-text",
|
|
272
|
-
children:
|
|
279
|
+
children: q
|
|
273
280
|
})]
|
|
274
281
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ D(k, {
|
|
276
283
|
treatment: "insight",
|
|
277
284
|
className: "p-4 border-border-seam space-y-2",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ E("div", {
|
|
279
286
|
className: "flex items-center gap-2",
|
|
280
|
-
children:
|
|
281
|
-
let e =
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
-
})(), /* @__PURE__ */
|
|
287
|
+
children: $ && /* @__PURE__ */ D(T, { children: [(() => {
|
|
288
|
+
let e = $.icon;
|
|
289
|
+
return /* @__PURE__ */ E(e, { className: "size-5 text-text-secondary" });
|
|
290
|
+
})(), /* @__PURE__ */ E("span", {
|
|
284
291
|
className: "font-medium",
|
|
285
|
-
children:
|
|
292
|
+
children: Q
|
|
286
293
|
})] })
|
|
287
|
-
}), /* @__PURE__ */
|
|
294
|
+
}), /* @__PURE__ */ E("p", {
|
|
288
295
|
className: "text-sm text-text-secondary",
|
|
289
|
-
children:
|
|
296
|
+
children: S("channel.platformLockedHint", "Platform cannot be changed after channel creation. Create a new channel to use a different platform.")
|
|
290
297
|
})]
|
|
291
298
|
}),
|
|
292
|
-
/* @__PURE__ */ O
|
|
293
|
-
|
|
294
|
-
className: "p-5 border-border-seam space-y-6",
|
|
299
|
+
/* @__PURE__ */ D(O, {
|
|
300
|
+
className: "p-5 space-y-6",
|
|
295
301
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ D("div", {
|
|
297
303
|
className: "space-y-2",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ D("label", {
|
|
299
305
|
className: "text-sm font-medium",
|
|
300
|
-
children: [
|
|
301
|
-
}), /* @__PURE__ */
|
|
302
|
-
"aria-label":
|
|
306
|
+
children: [S("channel.channelName", "Channel Name"), " *"]
|
|
307
|
+
}), /* @__PURE__ */ E("input", {
|
|
308
|
+
"aria-label": S("channel.editNamePlaceholder", "e.g., Production Email, Customer SMS"),
|
|
303
309
|
type: "text",
|
|
304
|
-
value:
|
|
305
|
-
onChange: (e) =>
|
|
306
|
-
placeholder:
|
|
310
|
+
value: N,
|
|
311
|
+
onChange: (e) => P(e.target.value),
|
|
312
|
+
placeholder: S("channel.editNamePlaceholder", "e.g., Production Email, Customer SMS"),
|
|
307
313
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary"
|
|
308
314
|
})]
|
|
309
315
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ D("div", {
|
|
311
317
|
className: "space-y-2",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ E("label", {
|
|
313
319
|
className: "text-sm font-medium",
|
|
314
|
-
children:
|
|
315
|
-
}), /* @__PURE__ */
|
|
316
|
-
"aria-label":
|
|
317
|
-
value:
|
|
318
|
-
onChange: (e) =>
|
|
319
|
-
placeholder:
|
|
320
|
+
children: S("channel.description", "Description")
|
|
321
|
+
}), /* @__PURE__ */ E("textarea", {
|
|
322
|
+
"aria-label": S("channel.editDescriptionPlaceholder", "Optional description for this channel"),
|
|
323
|
+
value: F,
|
|
324
|
+
onChange: (e) => I(e.target.value),
|
|
325
|
+
placeholder: S("channel.editDescriptionPlaceholder", "Optional description for this channel"),
|
|
320
326
|
rows: 3,
|
|
321
327
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary resize-none"
|
|
322
328
|
})]
|
|
323
329
|
}),
|
|
324
|
-
|
|
330
|
+
$ && /* @__PURE__ */ D("div", {
|
|
325
331
|
className: "space-y-2",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ E("label", {
|
|
327
333
|
className: "text-sm font-medium",
|
|
328
|
-
children:
|
|
329
|
-
}), /* @__PURE__ */
|
|
330
|
-
value:
|
|
331
|
-
onChange: (e) =>
|
|
334
|
+
children: S("channel.adapterProvider", "Adapter / Provider")
|
|
335
|
+
}), /* @__PURE__ */ E("select", {
|
|
336
|
+
value: L,
|
|
337
|
+
onChange: (e) => R(e.target.value),
|
|
332
338
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
333
|
-
children:
|
|
339
|
+
children: $.adapters.map((e) => /* @__PURE__ */ E("option", {
|
|
334
340
|
value: e.value,
|
|
335
341
|
children: e.label
|
|
336
342
|
}, e.value))
|
|
337
343
|
})]
|
|
338
344
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ D("div", {
|
|
340
346
|
className: "grid grid-cols-2 gap-4",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ D("div", {
|
|
342
348
|
className: "space-y-2",
|
|
343
349
|
children: [
|
|
344
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ E("label", {
|
|
345
351
|
className: "text-sm font-medium",
|
|
346
|
-
children:
|
|
352
|
+
children: S("channel.priority", "Priority")
|
|
347
353
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
value:
|
|
350
|
-
onChange: (e) =>
|
|
354
|
+
/* @__PURE__ */ E("select", {
|
|
355
|
+
value: z,
|
|
356
|
+
onChange: (e) => B(Number(e.target.value)),
|
|
351
357
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
352
|
-
children:
|
|
358
|
+
children: M.map((e) => /* @__PURE__ */ E("option", {
|
|
353
359
|
value: e.value,
|
|
354
360
|
children: e.label
|
|
355
361
|
}, e.value))
|
|
356
362
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ E("p", {
|
|
358
364
|
className: "text-xs text-text-secondary",
|
|
359
|
-
children:
|
|
365
|
+
children: S("channel.priorityFailoverHint", "Higher priority channels are used first in failover")
|
|
360
366
|
})
|
|
361
367
|
]
|
|
362
|
-
}), /* @__PURE__ */
|
|
368
|
+
}), /* @__PURE__ */ D("div", {
|
|
363
369
|
className: "space-y-2",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ E("label", {
|
|
365
371
|
className: "text-sm font-medium",
|
|
366
|
-
children:
|
|
367
|
-
}), /* @__PURE__ */
|
|
368
|
-
value:
|
|
369
|
-
onChange: (e) =>
|
|
372
|
+
children: S("channel.status", "Status")
|
|
373
|
+
}), /* @__PURE__ */ D("select", {
|
|
374
|
+
value: V,
|
|
375
|
+
onChange: (e) => H(e.target.value),
|
|
370
376
|
className: "w-full px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
371
377
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ E("option", {
|
|
373
379
|
value: "INACTIVE",
|
|
374
|
-
children:
|
|
380
|
+
children: S("channel.status.inactive", "Inactive")
|
|
375
381
|
}),
|
|
376
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ E("option", {
|
|
377
383
|
value: "ACTIVE",
|
|
378
|
-
children:
|
|
384
|
+
children: S("channel.status.active", "Active")
|
|
379
385
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ E("option", {
|
|
381
387
|
value: "SUSPENDED",
|
|
382
|
-
children:
|
|
388
|
+
children: S("channel.status.suspended", "Suspended")
|
|
383
389
|
})
|
|
384
390
|
]
|
|
385
391
|
})]
|
|
@@ -387,80 +393,80 @@ function M() {
|
|
|
387
393
|
})
|
|
388
394
|
]
|
|
389
395
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ D("div", {
|
|
391
397
|
className: "flex items-center justify-between pt-6 border-t",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ E("div", { children: Y ? /* @__PURE__ */ D("div", {
|
|
393
399
|
className: "flex items-center gap-2",
|
|
394
400
|
children: [
|
|
395
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ E("span", {
|
|
396
402
|
className: "text-sm text-text-secondary",
|
|
397
|
-
children:
|
|
403
|
+
children: S("channel.confirmDelete", "Confirm delete?")
|
|
398
404
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ D("button", {
|
|
400
406
|
type: "button",
|
|
401
407
|
onClick: async () => {
|
|
402
|
-
if (!(!
|
|
403
|
-
e("medium"),
|
|
408
|
+
if (!(!f || !Y)) {
|
|
409
|
+
e("medium"), K(!0);
|
|
404
410
|
try {
|
|
405
|
-
await
|
|
411
|
+
await y(f) ? (t("success"), d("../list")) : t("error");
|
|
406
412
|
} catch (e) {
|
|
407
|
-
t("error"),
|
|
413
|
+
t("error"), J(e instanceof Error ? e.message : S("channel.deleteFailed", "Failed to delete channel")), K(!1);
|
|
408
414
|
}
|
|
409
415
|
}
|
|
410
416
|
},
|
|
411
|
-
disabled:
|
|
417
|
+
disabled: G,
|
|
412
418
|
className: "px-4 py-2 text-sm bg-status-error-bg text-status-error-text rounded-lg hover:bg-status-error-bg/90 transition-colors flex items-center gap-2",
|
|
413
|
-
children: [
|
|
419
|
+
children: [G ? /* @__PURE__ */ E(m, { className: "size-4 animate-spin" }) : /* @__PURE__ */ E(x, { className: "size-4 " }), S("channel.delete", "Delete")]
|
|
414
420
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ E("button", {
|
|
416
422
|
type: "button",
|
|
417
|
-
onClick: () =>
|
|
423
|
+
onClick: () => X(!1),
|
|
418
424
|
className: "px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken rounded-lg transition-colors",
|
|
419
|
-
children:
|
|
425
|
+
children: S("channel.cancel", "Cancel")
|
|
420
426
|
})
|
|
421
427
|
]
|
|
422
|
-
}) : /* @__PURE__ */
|
|
428
|
+
}) : /* @__PURE__ */ E(i, {
|
|
423
429
|
permission: a.CHANNEL_DELETE,
|
|
424
|
-
children: /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ D("button", {
|
|
425
431
|
type: "button",
|
|
426
|
-
onClick: () =>
|
|
432
|
+
onClick: () => X(!0),
|
|
427
433
|
className: "px-4 py-2 text-sm text-status-error-text hover:bg-status-error-bg/10 rounded-lg transition-colors flex items-center gap-2",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ E(x, { className: "size-4 " }), S("channel.deleteChannel", "Delete Channel")]
|
|
429
435
|
})
|
|
430
|
-
}) }), /* @__PURE__ */
|
|
436
|
+
}) }), /* @__PURE__ */ D("div", {
|
|
431
437
|
className: "flex items-center gap-3",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ E("button", {
|
|
433
439
|
type: "button",
|
|
434
|
-
onClick: () =>
|
|
440
|
+
onClick: () => d(`/channels/${f}`),
|
|
435
441
|
className: "px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken rounded-lg transition-colors",
|
|
436
|
-
children:
|
|
437
|
-
}), /* @__PURE__ */
|
|
442
|
+
children: S("channel.cancel", "Cancel")
|
|
443
|
+
}), /* @__PURE__ */ D("button", {
|
|
438
444
|
type: "button",
|
|
439
445
|
onClick: async () => {
|
|
440
|
-
if (
|
|
441
|
-
if (!
|
|
442
|
-
|
|
446
|
+
if (f) {
|
|
447
|
+
if (!N.trim()) {
|
|
448
|
+
J(S("channel.validation.nameRequired", "Channel name is required"));
|
|
443
449
|
return;
|
|
444
450
|
}
|
|
445
|
-
|
|
451
|
+
W(!0), J(null);
|
|
446
452
|
try {
|
|
447
|
-
await
|
|
448
|
-
name:
|
|
449
|
-
description:
|
|
450
|
-
adapterType:
|
|
451
|
-
priority:
|
|
452
|
-
status:
|
|
453
|
-
}) ?
|
|
453
|
+
await _(f, {
|
|
454
|
+
name: N.trim(),
|
|
455
|
+
description: F.trim() || void 0,
|
|
456
|
+
adapterType: L,
|
|
457
|
+
priority: z,
|
|
458
|
+
status: V
|
|
459
|
+
}) ? d(`/channels/${f}`) : J(S("channel.updateFailed", "Failed to update channel"));
|
|
454
460
|
} catch (e) {
|
|
455
|
-
|
|
461
|
+
J(e instanceof Error ? e.message : S("channel.updateFailed", "Failed to update channel"));
|
|
456
462
|
} finally {
|
|
457
|
-
|
|
463
|
+
W(!1);
|
|
458
464
|
}
|
|
459
465
|
}
|
|
460
466
|
},
|
|
461
|
-
disabled:
|
|
467
|
+
disabled: U || !N.trim(),
|
|
462
468
|
className: "px-6 py-2 text-sm bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors flex items-center gap-2 disabled:opacity-50",
|
|
463
|
-
children: [
|
|
469
|
+
children: [U ? /* @__PURE__ */ E(m, { className: "size-4 animate-spin" }) : /* @__PURE__ */ E(v, { className: "size-4 " }), S("channel.saveChanges", "Save Changes")]
|
|
464
470
|
})]
|
|
465
471
|
})]
|
|
466
472
|
})
|
|
@@ -471,6 +477,6 @@ function M() {
|
|
|
471
477
|
});
|
|
472
478
|
}
|
|
473
479
|
//#endregion
|
|
474
|
-
export {
|
|
480
|
+
export { N as EditChannelPage };
|
|
475
481
|
|
|
476
482
|
//# sourceMappingURL=EditChannelPage.js.map
|