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