@burdenoff/microfe-channel 2026.527.1 → 2026.530.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.
Files changed (25) hide show
  1. package/dist/channel/ChannelRoutes.js +5 -5
  2. package/dist/channel/ChannelRoutes.js.map +1 -1
  3. package/dist/channel/constants/permissions.js +3 -0
  4. package/dist/channel/constants/permissions.js.map +1 -1
  5. package/dist/channel/modules/channels/pages/ChannelDashboardPage.js +227 -221
  6. package/dist/channel/modules/channels/pages/ChannelDashboardPage.js.map +1 -1
  7. package/dist/channel/modules/channels/pages/ChannelDetailsPage.js +392 -391
  8. package/dist/channel/modules/channels/pages/ChannelDetailsPage.js.map +1 -1
  9. package/dist/channel/modules/channels/pages/ChannelUsersPage.js +1 -1
  10. package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
  11. package/dist/channel/modules/channels/pages/ChannelsListPage.js +216 -212
  12. package/dist/channel/modules/channels/pages/ChannelsListPage.js.map +1 -1
  13. package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +99 -98
  14. package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
  15. package/dist/channel/modules/channels/pages/ConnectionsListPage.js +129 -126
  16. package/dist/channel/modules/channels/pages/ConnectionsListPage.js.map +1 -1
  17. package/dist/channel/modules/channels/pages/CreateChannelPage.js +40 -50
  18. package/dist/channel/modules/channels/pages/CreateChannelPage.js.map +1 -1
  19. package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js +1 -1
  20. package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js.map +1 -1
  21. package/dist/channel/modules/channels/pages/WebhookEventsPage.js +1 -1
  22. package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
  23. package/dist/channel/pages/ChannelLandingPage.js +50 -34
  24. package/dist/channel/pages/ChannelLandingPage.js.map +1 -1
  25. package/package.json +2 -2
@@ -1,128 +1,129 @@
1
1
  import { useChannel as e } from "../../../providers/ChannelProvider.js";
2
2
  import { nativeImpact as t, nativeNotify as n } from "../../../../utils/nativeBridge.js";
3
- import { reportShellError as r } from "../../../utils/shellBridge.js";
4
- import { getGlobalChannelClient as i } from "../../../graphql/global-client.js";
5
- import { GetConnectionDocument as a } from "../../../../generated/global-operations.js";
6
- import { useChannel as o } from "../../../hooks/useChannels.js";
7
- import { PermissionGuard as s } from "../../../components/PermissionGuard.js";
8
- import { CHANNEL_PERMISSIONS as c } from "../../../constants/permissions.js";
9
- import { useEffect as l, useState as u } from "react";
10
- import { useI18n as d } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
- import { AlertCircle as f, ArrowLeft as p, CheckCircle2 as m, Clock as h, Edit as g, Loader2 as _, RefreshCw as v, Shield as y, Trash2 as b, XCircle as x } from "lucide-react";
12
- import { useNavigate as S, useParams as C } from "react-router-dom";
3
+ import { reportShellError as ee } from "../../../utils/shellBridge.js";
4
+ import { getGlobalChannelClient as r } from "../../../graphql/global-client.js";
5
+ import { GetConnectionDocument as i } from "../../../../generated/global-operations.js";
6
+ import { useChannel as a } from "../../../hooks/useChannels.js";
7
+ import { PermissionGuard as o } from "../../../components/PermissionGuard.js";
8
+ import { CHANNEL_PERMISSIONS as s } from "../../../constants/permissions.js";
9
+ import { useEffect as c, useState as l } from "react";
10
+ import { useI18n as u } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
+ import { AlertCircle as d, ArrowLeft as f, CheckCircle2 as p, Clock as m, Edit as h, Loader2 as g, RefreshCw as _, Shield as v, Trash2 as y, XCircle as b } from "lucide-react";
12
+ import { useNavigate as x, useParams as S } from "react-router-dom";
13
+ import { usePermissions as C } from "@burdenoff/fe-libs/shared/providers/shell";
13
14
  import { jsx as w, jsxs as T } from "react/jsx-runtime";
14
15
  import { TagBadge as E } from "@burdenoff/fe-libs/tag";
15
16
  //#region src/channel/modules/channels/pages/ConnectionDetailsPage.tsx
16
17
  var D = {
17
18
  true: {
18
- icon: m,
19
+ icon: p,
19
20
  color: "text-status-success-text",
20
21
  bgColor: "bg-status-success-bg-subtle",
21
22
  label: "Healthy"
22
23
  },
23
24
  false: {
24
- icon: x,
25
+ icon: b,
25
26
  color: "text-status-error-text",
26
27
  bgColor: "bg-error-500/10",
27
28
  label: "Unhealthy"
28
29
  }
29
30
  };
30
31
  function O() {
31
- let m = S(), x = C(), { connectionId: O } = x, { authToken: k, apiGatewayUrl: A, organizationId: j } = e(), [M, N] = u(x.channelId), [P, F] = u(null);
32
- l(() => {
33
- if (M || !O) return;
32
+ let p = x(), { hasPermission: b } = C(), O = b(s.CHANNEL_UPDATE), k = S(), { connectionId: A } = k, { authToken: j, apiGatewayUrl: M, organizationId: N } = e(), [P, F] = l(k.channelId), [I, L] = l(null);
33
+ c(() => {
34
+ if (P || !A) return;
34
35
  let e = !1;
35
36
  return (async () => {
36
37
  try {
37
- let t = await i(A, k, j).query({
38
- query: a,
39
- variables: { id: O },
38
+ let t = await r(M, j, N).query({
39
+ query: i,
40
+ variables: { id: A },
40
41
  fetchPolicy: "network-only"
41
42
  });
42
43
  if (e) return;
43
44
  let n = t.data?.getConnection;
44
- n?.channelId ? N(n.channelId) : F("Connection not found");
45
+ n?.channelId ? F(n.channelId) : L("Connection not found");
45
46
  } catch (t) {
46
- e || F(t instanceof Error ? t.message : "Failed to resolve connection");
47
+ e || L(t instanceof Error ? t.message : "Failed to resolve connection");
47
48
  }
48
49
  })(), () => {
49
50
  e = !0;
50
51
  };
51
52
  }, [
52
- O,
53
- M,
54
53
  A,
55
- k,
56
- j
54
+ P,
55
+ M,
56
+ j,
57
+ N
57
58
  ]);
58
- let I = M, { channel: L, isLoading: R, error: z, runHealthCheck: B, deleteConnection: V } = o(I), { t: H } = d(), U = (e, t) => {
59
- let n = H(e);
59
+ let R = P, { channel: z, isLoading: B, error: V, runHealthCheck: H, deleteConnection: U } = a(R), { t: W } = u(), G = (e, t) => {
60
+ let n = W(e);
60
61
  return n === e ? t : n;
61
- }, [W, G] = u(!1), [K, q] = u(!1), [J, Y] = u(!1), X = L?.connection, Z = async () => {
62
- q(!0);
62
+ }, [K, q] = l(!1), [J, Y] = l(!1), [X, Z] = l(!1), Q = z?.connection, te = async () => {
63
+ Y(!0);
63
64
  try {
64
- await B();
65
+ await H();
65
66
  } finally {
66
- q(!1);
67
+ Y(!1);
67
68
  }
68
- }, Q = async () => {
69
- if (O) {
70
- t("medium"), G(!0);
69
+ }, ne = async () => {
70
+ if (A) {
71
+ t("medium"), q(!0);
71
72
  try {
72
- await V(O), n("success"), m(`/channels/${I}`);
73
+ await U(A), n("success"), p(`/channels/${R}`);
73
74
  } catch (e) {
74
- n("error"), r(e, {
75
+ n("error"), ee(e, {
75
76
  module: "channel",
76
77
  context: { action: "Failed to delete connection" }
77
78
  }, "[channel] Failed to delete connection");
78
79
  } finally {
79
- G(!1);
80
+ q(!1);
80
81
  }
81
82
  }
82
83
  };
83
- if (R || !M && !P) return /* @__PURE__ */ w("div", {
84
+ if (B || !P && !I) return /* @__PURE__ */ w("div", {
84
85
  className: "flex items-center justify-center min-h-screen",
85
- children: /* @__PURE__ */ w(_, { className: "size-8 animate-spin text-muted-foreground" })
86
+ children: /* @__PURE__ */ w(g, { className: "size-8 animate-spin text-muted-foreground" })
86
87
  });
87
- if (P || z || !L) return /* @__PURE__ */ T("div", {
88
+ if (I || V || !z) return /* @__PURE__ */ T("div", {
88
89
  className: "flex flex-col items-center justify-center min-h-screen gap-4",
89
90
  children: [
90
- /* @__PURE__ */ w(f, { className: "size-12 text-destructive" }),
91
+ /* @__PURE__ */ w(d, { className: "size-12 text-destructive" }),
91
92
  /* @__PURE__ */ w("h1", {
92
93
  className: "text-xl font-semibold",
93
- children: U("channel.channelNotFound", "Channel not found")
94
+ children: G("channel.channelNotFound", "Channel not found")
94
95
  }),
95
96
  /* @__PURE__ */ w("button", {
96
97
  type: "button",
97
- onClick: () => m("../../list"),
98
+ onClick: () => p("../../list"),
98
99
  className: "text-primary hover:underline",
99
- children: U("channel.backToChannels", "Back to channels")
100
+ children: G("channel.backToChannels", "Back to channels")
100
101
  })
101
102
  ]
102
103
  });
103
- if (!X) return /* @__PURE__ */ T("div", {
104
+ if (!Q) return /* @__PURE__ */ T("div", {
104
105
  className: "flex flex-col items-center justify-center min-h-screen gap-4",
105
106
  children: [
106
- /* @__PURE__ */ w(f, { className: "size-12 text-muted-foreground" }),
107
+ /* @__PURE__ */ w(d, { className: "size-12 text-muted-foreground" }),
107
108
  /* @__PURE__ */ w("h1", {
108
109
  className: "text-xl font-semibold",
109
- children: U("channel.noConnectionFound", "No connection found")
110
+ children: G("channel.noConnectionFound", "No connection found")
110
111
  }),
111
112
  /* @__PURE__ */ w("p", {
112
113
  className: "text-sm text-muted-foreground",
113
- children: U("channel.noConnectionConfigured", "This channel does not have a connection configured.")
114
+ children: G("channel.noConnectionConfigured", "This channel does not have a connection configured.")
114
115
  }),
115
116
  /* @__PURE__ */ w("button", {
116
117
  type: "button",
117
- onClick: () => m(`/channels/${I}`),
118
+ onClick: () => p(`/channels/${R}`),
118
119
  className: "text-primary hover:underline",
119
- children: U("channel.backToChannel", "Back to channel")
120
+ children: G("channel.backToChannel", "Back to channel")
120
121
  })
121
122
  ]
122
123
  });
123
- let $ = D[String(X.isHealthy)] || D.false, ee = $.icon;
124
- return /* @__PURE__ */ w(s, {
125
- permission: c.CHANNEL_CONNECTION_READ,
124
+ let $ = D[String(Q.isHealthy)] || D.false, re = $.icon;
125
+ return /* @__PURE__ */ w(o, {
126
+ permission: s.CHANNEL_CONNECTION_READ,
126
127
  children: /* @__PURE__ */ T("div", {
127
128
  className: "min-h-screen bg-background",
128
129
  children: [/* @__PURE__ */ w("div", {
@@ -135,36 +136,36 @@ function O() {
135
136
  className: "flex items-center gap-4",
136
137
  children: [/* @__PURE__ */ w("button", {
137
138
  type: "button",
138
- onClick: () => m(`/channels/${I}`),
139
+ onClick: () => p(`/channels/${R}`),
139
140
  className: "p-2 hover:bg-muted rounded-lg transition-colors",
140
- children: /* @__PURE__ */ w(p, { className: "size-5 " })
141
+ children: /* @__PURE__ */ w(f, { className: "size-5 " })
141
142
  }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h1", {
142
143
  className: "text-2xl font-bold",
143
- children: U("channel.connectionDetails", "Connection Details")
144
+ children: G("channel.connectionDetails", "Connection Details")
144
145
  }), /* @__PURE__ */ T("p", {
145
146
  className: "text-sm text-muted-foreground",
146
147
  children: [
147
- L.name,
148
+ z.name,
148
149
  " • ",
149
- L.platform
150
+ z.platform
150
151
  ]
151
152
  })] })]
152
153
  }), /* @__PURE__ */ T("div", {
153
154
  className: "flex items-center gap-2",
154
- children: [/* @__PURE__ */ w(s, {
155
- permission: c.CHANNEL_EXECUTE,
155
+ children: [/* @__PURE__ */ w(o, {
156
+ permission: s.CHANNEL_EXECUTE,
156
157
  children: /* @__PURE__ */ T("button", {
157
158
  type: "button",
158
- onClick: Z,
159
- disabled: K,
159
+ onClick: te,
160
+ disabled: J,
160
161
  className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors flex items-center gap-2",
161
- children: [K ? /* @__PURE__ */ w(_, { className: "size-4 animate-spin" }) : /* @__PURE__ */ w(v, { className: "size-4 " }), U("channel.runHealthCheck", "Run Health Check")]
162
+ children: [J ? /* @__PURE__ */ w(g, { className: "size-4 animate-spin" }) : /* @__PURE__ */ w(_, { className: "size-4 " }), G("channel.runHealthCheck", "Run Health Check")]
162
163
  })
163
- }), /* @__PURE__ */ T("button", {
164
+ }), O && /* @__PURE__ */ T("button", {
164
165
  type: "button",
165
- onClick: () => m(`/channels/${I}/edit`),
166
+ onClick: () => p(`/channels/${R}/edit`),
166
167
  className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors flex items-center gap-2",
167
- children: [/* @__PURE__ */ w(g, { className: "size-4 " }), U("channel.editChannel", "Edit Channel")]
168
+ children: [/* @__PURE__ */ w(h, { className: "size-4 " }), G("channel.editChannel", "Edit Channel")]
168
169
  })]
169
170
  })]
170
171
  })
@@ -180,13 +181,13 @@ function O() {
180
181
  className: "flex items-center gap-4",
181
182
  children: [/* @__PURE__ */ w("div", {
182
183
  className: $.color,
183
- children: /* @__PURE__ */ w(ee, { className: "size-10 " })
184
+ children: /* @__PURE__ */ w(re, { className: "size-10 " })
184
185
  }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h2", {
185
186
  className: "text-xl font-semibold",
186
187
  children: $.label
187
188
  }), /* @__PURE__ */ w("p", {
188
189
  className: "text-sm text-muted-foreground",
189
- children: X.isHealthy ? U("channel.connectionWorking", "Connection is working properly") : U("channel.connectionNotWorking", "Connection is not working properly")
190
+ children: Q.isHealthy ? G("channel.connectionWorking", "Connection is working properly") : G("channel.connectionNotWorking", "Connection is not working properly")
190
191
  })] })]
191
192
  })
192
193
  })
@@ -196,7 +197,7 @@ function O() {
196
197
  children: [
197
198
  /* @__PURE__ */ w("h3", {
198
199
  className: "font-semibold",
199
- children: U("channel.connectionInformation", "Connection Information")
200
+ children: G("channel.connectionInformation", "Connection Information")
200
201
  }),
201
202
  /* @__PURE__ */ T("div", {
202
203
  className: "grid grid-cols-2 gap-4",
@@ -206,46 +207,46 @@ function O() {
206
207
  children: "Connection ID"
207
208
  }), /* @__PURE__ */ w("p", {
208
209
  className: "font-mono text-sm",
209
- children: X.id
210
+ children: Q.id
210
211
  })] }),
211
212
  /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
212
213
  className: "text-sm text-muted-foreground",
213
214
  children: "Auth Type"
214
215
  }), /* @__PURE__ */ T("p", {
215
216
  className: "flex items-center gap-2",
216
- children: [/* @__PURE__ */ w(y, { className: "size-4 text-muted-foreground" }), X.authType]
217
+ children: [/* @__PURE__ */ w(v, { className: "size-4 text-muted-foreground" }), Q.authType]
217
218
  })] }),
218
219
  /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
219
220
  className: "text-sm text-muted-foreground",
220
221
  children: "Status"
221
222
  }), /* @__PURE__ */ w("p", {
222
- className: X.isActive ? "text-status-success-text" : "text-muted-foreground",
223
- children: X.isActive ? U("channel.activeStatus", "Active") : U("channel.inactiveStatus", "Inactive")
223
+ className: Q.isActive ? "text-status-success-text" : "text-muted-foreground",
224
+ children: Q.isActive ? G("channel.activeStatus", "Active") : G("channel.inactiveStatus", "Inactive")
224
225
  })] }),
225
226
  /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
226
227
  className: "text-sm text-muted-foreground",
227
228
  children: "Token Refresh"
228
229
  }), /* @__PURE__ */ w("p", {
229
- className: X.needsTokenRefresh ? "text-status-warning-text" : "text-muted-foreground",
230
- children: X.needsTokenRefresh ? U("channel.tokenRefreshRequired", "Required soon") : U("channel.tokenRefreshNotNeeded", "Not needed")
230
+ className: Q.needsTokenRefresh ? "text-status-warning-text" : "text-muted-foreground",
231
+ children: Q.needsTokenRefresh ? G("channel.tokenRefreshRequired", "Required soon") : G("channel.tokenRefreshNotNeeded", "Not needed")
231
232
  })] }),
232
- X.lastTestedAt && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
233
+ Q.lastTestedAt && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
233
234
  className: "text-sm text-muted-foreground",
234
235
  children: "Last Tested"
235
236
  }), /* @__PURE__ */ T("p", {
236
237
  className: "flex items-center gap-2",
237
- children: [/* @__PURE__ */ w(h, { className: "size-4 text-muted-foreground" }), new Date(X.lastTestedAt).toLocaleString()]
238
+ children: [/* @__PURE__ */ w(m, { className: "size-4 text-muted-foreground" }), new Date(Q.lastTestedAt).toLocaleString()]
238
239
  })] }),
239
- X.daysUntilExpiry !== null && X.daysUntilExpiry !== void 0 && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
240
+ Q.daysUntilExpiry !== null && Q.daysUntilExpiry !== void 0 && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
240
241
  className: "text-sm text-muted-foreground",
241
242
  children: "Days Until Token Expiry"
242
243
  }), /* @__PURE__ */ T("p", {
243
- className: X.daysUntilExpiry < 30 ? "text-status-warning-text" : "text-muted-foreground",
244
- children: [X.daysUntilExpiry, " days"]
244
+ className: Q.daysUntilExpiry < 30 ? "text-status-warning-text" : "text-muted-foreground",
245
+ children: [Q.daysUntilExpiry, " days"]
245
246
  })] })
246
247
  ]
247
248
  }),
248
- X.testStatus && /* @__PURE__ */ T("div", {
249
+ Q.testStatus && /* @__PURE__ */ T("div", {
249
250
  className: "pt-4 border-t",
250
251
  children: [/* @__PURE__ */ w("p", {
251
252
  className: "text-sm text-muted-foreground mb-2",
@@ -254,19 +255,19 @@ function O() {
254
255
  className: "p-3 rounded-lg bg-muted",
255
256
  children: /* @__PURE__ */ w("p", {
256
257
  className: "font-mono text-sm",
257
- children: X.testStatus
258
+ children: Q.testStatus
258
259
  })
259
260
  })]
260
261
  }),
261
- X.tagAssignments && X.tagAssignments.length > 0 && /* @__PURE__ */ T("div", {
262
+ Q.tagAssignments && Q.tagAssignments.length > 0 && /* @__PURE__ */ T("div", {
262
263
  className: "pt-4 border-t",
263
264
  children: [/* @__PURE__ */ w("p", {
264
265
  className: "text-sm text-muted-foreground mb-2",
265
- children: U("channel.tags", "Tags")
266
+ children: G("channel.tags", "Tags")
266
267
  }), /* @__PURE__ */ w("div", {
267
268
  className: "flex flex-wrap gap-1.5",
268
269
  "aria-label": "Connection tags",
269
- children: X.tagAssignments.map((e) => /* @__PURE__ */ w(E, {
270
+ children: Q.tagAssignments.map((e) => /* @__PURE__ */ w(E, {
270
271
  id: e.tagId,
271
272
  label: e.tagId,
272
273
  size: "md"
@@ -279,43 +280,43 @@ function O() {
279
280
  className: "border rounded-lg p-6 space-y-4",
280
281
  children: [/* @__PURE__ */ w("h3", {
281
282
  className: "font-semibold",
282
- children: U("channel.actions", "Actions")
283
+ children: G("channel.actions", "Actions")
283
284
  }), /* @__PURE__ */ T("div", {
284
285
  className: "flex items-center justify-between",
285
286
  children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
286
287
  className: "font-medium",
287
- children: U("channel.deleteConnection", "Delete Connection")
288
+ children: G("channel.deleteConnection", "Delete Connection")
288
289
  }), /* @__PURE__ */ w("p", {
289
290
  className: "text-sm text-muted-foreground",
290
- children: U("channel.deleteConnectionWarning", "Permanently remove this connection. The channel will become inactive.")
291
- })] }), J ? /* @__PURE__ */ T("div", {
291
+ children: G("channel.deleteConnectionWarning", "Permanently remove this connection. The channel will become inactive.")
292
+ })] }), X ? /* @__PURE__ */ T("div", {
292
293
  className: "flex items-center gap-2",
293
294
  children: [
294
295
  /* @__PURE__ */ w("span", {
295
296
  className: "text-sm text-muted-foreground",
296
- children: U("channel.confirmDelete", "Confirm delete?")
297
+ children: G("channel.confirmDelete", "Confirm delete?")
297
298
  }),
298
299
  /* @__PURE__ */ T("button", {
299
300
  type: "button",
300
- onClick: Q,
301
- disabled: W,
301
+ onClick: ne,
302
+ disabled: K,
302
303
  className: "px-4 py-2 rounded-lg bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors flex items-center gap-2",
303
- children: [W ? /* @__PURE__ */ w(_, { className: "size-4 animate-spin" }) : /* @__PURE__ */ w(b, { className: "size-4 " }), U("channel.delete", "Delete")]
304
+ children: [K ? /* @__PURE__ */ w(g, { className: "size-4 animate-spin" }) : /* @__PURE__ */ w(y, { className: "size-4 " }), G("channel.delete", "Delete")]
304
305
  }),
305
306
  /* @__PURE__ */ w("button", {
306
307
  type: "button",
307
- onClick: () => Y(!1),
308
+ onClick: () => Z(!1),
308
309
  className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors",
309
- children: U("channel.cancel", "Cancel")
310
+ children: G("channel.cancel", "Cancel")
310
311
  })
311
312
  ]
312
- }) : /* @__PURE__ */ w(s, {
313
- permission: c.CHANNEL_CONNECTION_DELETE,
313
+ }) : /* @__PURE__ */ w(o, {
314
+ permission: s.CHANNEL_CONNECTION_DELETE,
314
315
  children: /* @__PURE__ */ T("button", {
315
316
  type: "button",
316
- onClick: () => Y(!0),
317
+ onClick: () => Z(!0),
317
318
  className: "px-4 py-2 rounded-lg text-destructive border border-destructive hover:bg-destructive/10 transition-colors flex items-center gap-2",
318
- children: [/* @__PURE__ */ w(b, { className: "size-4 " }), U("channel.delete", "Delete")]
319
+ children: [/* @__PURE__ */ w(y, { className: "size-4 " }), G("channel.delete", "Delete")]
319
320
  })
320
321
  })]
321
322
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionDetailsPage.js","names":[],"sources":["../../../../../src/channel/modules/channels/pages/ConnectionDetailsPage.tsx"],"sourcesContent":["/**\n * Connection Details Page\n *\n * View and manage a specific connection within a channel.\n */\n\nimport { useEffect, useState } from 'react';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { TagBadge } from '@burdenoff/fe-libs/tag';\nimport { reportShellError } from '../../../utils/shellBridge';\nimport { nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport {\n ArrowLeft,\n Loader2,\n AlertCircle,\n CheckCircle2,\n XCircle,\n RefreshCw,\n Trash2,\n Edit,\n Shield,\n Clock,\n} from 'lucide-react';\nimport { useChannel } from '../../../hooks/useChannels';\nimport { useChannel as useChannelContext } from '../../../providers/ChannelProvider';\nimport { getGlobalChannelClient } from '../../../graphql/global-client';\nimport {\n GetConnectionDocument,\n type GetConnectionQuery,\n} from '../../../../generated/global-operations';\nimport { PermissionGuard } from '../../../components/PermissionGuard';\nimport { CHANNEL_PERMISSIONS } from '../../../constants/permissions';\n\nconst HEALTH_CONFIG: Record<\n string,\n { icon: typeof CheckCircle2; color: string; bgColor: string; label: string }\n> = {\n true: {\n icon: CheckCircle2,\n color: 'text-status-success-text',\n bgColor: 'bg-status-success-bg-subtle',\n label: 'Healthy',\n },\n false: {\n icon: XCircle,\n color: 'text-status-error-text',\n bgColor: 'bg-error-500/10',\n label: 'Unhealthy',\n },\n};\n\nexport function ConnectionDetailsPage() {\n const navigate = useNavigate();\n const params = useParams<{ channelId?: string; connectionId: string }>();\n const { connectionId } = params;\n const { authToken, apiGatewayUrl, organizationId } = useChannelContext();\n\n // Route may be /channels/connections/:connectionId (no channelId in URL).\n // Resolve channelId from getConnection when absent so downstream channel hooks work.\n const [resolvedChannelId, setResolvedChannelId] = useState<string | undefined>(params.channelId);\n const [resolveError, setResolveError] = useState<string | null>(null);\n\n useEffect(() => {\n if (resolvedChannelId || !connectionId) return;\n let cancelled = false;\n void (async () => {\n try {\n const client = getGlobalChannelClient(apiGatewayUrl, authToken, organizationId);\n const result = await client.query<GetConnectionQuery>({\n query: GetConnectionDocument,\n variables: { id: connectionId },\n fetchPolicy: 'network-only',\n });\n if (cancelled) return;\n const conn = result.data?.getConnection;\n if (conn?.channelId) setResolvedChannelId(conn.channelId);\n else setResolveError('Connection not found');\n } catch (err) {\n if (!cancelled)\n setResolveError(err instanceof Error ? err.message : 'Failed to resolve connection');\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [connectionId, resolvedChannelId, apiGatewayUrl, authToken, organizationId]);\n\n const channelId = resolvedChannelId;\n const { channel, isLoading, error, runHealthCheck, deleteConnection } = useChannel(channelId);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n const [isDeleting, setIsDeleting] = useState(false);\n const [isRunningHealth, setIsRunningHealth] = useState(false);\n const [deleteConfirm, setDeleteConfirm] = useState(false);\n\n const connection = channel?.connection;\n\n // Run health check\n const handleRunHealthCheck = async () => {\n setIsRunningHealth(true);\n try {\n await runHealthCheck();\n } finally {\n setIsRunningHealth(false);\n }\n };\n\n // Delete connection\n const handleDelete = async () => {\n if (!connectionId) return;\n void nativeImpact('medium');\n setIsDeleting(true);\n try {\n // deleteConnection throws on failure; success is guaranteed if it returns.\n await deleteConnection(connectionId);\n void nativeNotify('success');\n navigate(`/channels/${channelId}`);\n } catch (err) {\n void nativeNotify('error');\n reportShellError(\n err,\n { module: 'channel', context: { action: 'Failed to delete connection' } },\n '[channel] Failed to delete connection'\n );\n } finally {\n setIsDeleting(false);\n }\n };\n\n if (isLoading || (!resolvedChannelId && !resolveError)) {\n return (\n <div className=\"flex items-center justify-center min-h-screen\">\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (resolveError || error || !channel) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-screen gap-4\">\n <AlertCircle className=\"size-12 text-destructive\" />\n <h1 className=\"text-xl font-semibold\">\n {tr('channel.channelNotFound', 'Channel not found')}\n </h1>\n <button\n type=\"button\"\n onClick={() => navigate('../../list')}\n className=\"text-primary hover:underline\"\n >\n {tr('channel.backToChannels', 'Back to channels')}\n </button>\n </div>\n );\n }\n\n if (!connection) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-screen gap-4\">\n <AlertCircle className=\"size-12 text-muted-foreground\" />\n <h1 className=\"text-xl font-semibold\">\n {tr('channel.noConnectionFound', 'No connection found')}\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {tr(\n 'channel.noConnectionConfigured',\n 'This channel does not have a connection configured.'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigate(`/channels/${channelId}`)}\n className=\"text-primary hover:underline\"\n >\n {tr('channel.backToChannel', 'Back to channel')}\n </button>\n </div>\n );\n }\n\n const health = HEALTH_CONFIG[String(connection.isHealthy)] || HEALTH_CONFIG.false;\n const HealthIcon = health.icon;\n\n return (\n <PermissionGuard permission={CHANNEL_PERMISSIONS.CHANNEL_CONNECTION_READ}>\n <div className=\"min-h-screen bg-background\">\n {/* Header */}\n <div className=\"border-b bg-card\">\n <div className=\"container mx-auto px-6 py-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate(`/channels/${channelId}`)}\n className=\"p-2 hover:bg-muted rounded-lg transition-colors\"\n >\n <ArrowLeft className=\"size-5 \" />\n </button>\n <div>\n <h1 className=\"text-2xl font-bold\">\n {tr('channel.connectionDetails', 'Connection Details')}\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {channel.name} • {channel.platform}\n </p>\n </div>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <PermissionGuard permission={CHANNEL_PERMISSIONS.CHANNEL_EXECUTE}>\n <button\n type=\"button\"\n onClick={handleRunHealthCheck}\n disabled={isRunningHealth}\n className=\"px-4 py-2 rounded-lg border hover:bg-muted transition-colors flex items-center gap-2\"\n >\n {isRunningHealth ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <RefreshCw className=\"size-4 \" />\n )}\n {tr('channel.runHealthCheck', 'Run Health Check')}\n </button>\n </PermissionGuard>\n <button\n type=\"button\"\n onClick={() => navigate(`/channels/${channelId}/edit`)}\n className=\"px-4 py-2 rounded-lg border hover:bg-muted transition-colors flex items-center gap-2\"\n >\n <Edit className=\"size-4 \" />\n {tr('channel.editChannel', 'Edit Channel')}\n </button>\n </div>\n </div>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"container mx-auto px-6 py-8 max-w-3xl space-y-6\">\n {/* Health Status */}\n <div className={`p-6 rounded-lg border ${health.bgColor}`}>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <div className={health.color}>\n <HealthIcon className=\"size-10 \" />\n </div>\n <div>\n <h2 className=\"text-xl font-semibold\">{health.label}</h2>\n <p className=\"text-sm text-muted-foreground\">\n {connection.isHealthy\n ? tr('channel.connectionWorking', 'Connection is working properly')\n : tr('channel.connectionNotWorking', 'Connection is not working properly')}\n </p>\n </div>\n </div>\n </div>\n </div>\n\n {/* Connection Info */}\n <div className=\"border rounded-lg p-6 space-y-4\">\n <h3 className=\"font-semibold\">\n {tr('channel.connectionInformation', 'Connection Information')}\n </h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <p className=\"text-sm text-muted-foreground\">Connection ID</p>\n <p className=\"font-mono text-sm\">{connection.id}</p>\n </div>\n\n <div>\n <p className=\"text-sm text-muted-foreground\">Auth Type</p>\n <p className=\"flex items-center gap-2\">\n <Shield className=\"size-4 text-muted-foreground\" />\n {connection.authType}\n </p>\n </div>\n\n <div>\n <p className=\"text-sm text-muted-foreground\">Status</p>\n <p\n className={\n connection.isActive ? 'text-status-success-text' : 'text-muted-foreground'\n }\n >\n {connection.isActive\n ? tr('channel.activeStatus', 'Active')\n : tr('channel.inactiveStatus', 'Inactive')}\n </p>\n </div>\n\n <div>\n <p className=\"text-sm text-muted-foreground\">Token Refresh</p>\n <p\n className={\n connection.needsTokenRefresh\n ? 'text-status-warning-text'\n : 'text-muted-foreground'\n }\n >\n {connection.needsTokenRefresh\n ? tr('channel.tokenRefreshRequired', 'Required soon')\n : tr('channel.tokenRefreshNotNeeded', 'Not needed')}\n </p>\n </div>\n\n {connection.lastTestedAt && (\n <div>\n <p className=\"text-sm text-muted-foreground\">Last Tested</p>\n <p className=\"flex items-center gap-2\">\n <Clock className=\"size-4 text-muted-foreground\" />\n {new Date(connection.lastTestedAt).toLocaleString()}\n </p>\n </div>\n )}\n\n {connection.daysUntilExpiry !== null && connection.daysUntilExpiry !== undefined && (\n <div>\n <p className=\"text-sm text-muted-foreground\">Days Until Token Expiry</p>\n <p\n className={\n connection.daysUntilExpiry < 30\n ? 'text-status-warning-text'\n : 'text-muted-foreground'\n }\n >\n {connection.daysUntilExpiry} days\n </p>\n </div>\n )}\n </div>\n\n {connection.testStatus && (\n <div className=\"pt-4 border-t\">\n <p className=\"text-sm text-muted-foreground mb-2\">Last Test Status</p>\n <div className=\"p-3 rounded-lg bg-muted\">\n <p className=\"font-mono text-sm\">{connection.testStatus}</p>\n </div>\n </div>\n )}\n\n {connection.tagAssignments && connection.tagAssignments.length > 0 && (\n <div className=\"pt-4 border-t\">\n <p className=\"text-sm text-muted-foreground mb-2\">{tr('channel.tags', 'Tags')}</p>\n <div className=\"flex flex-wrap gap-1.5\" aria-label=\"Connection tags\">\n {connection.tagAssignments.map((a) => (\n <TagBadge key={a.id} id={a.tagId} label={a.tagId} size=\"md\" />\n ))}\n </div>\n </div>\n )}\n </div>\n\n {/* Actions */}\n <div className=\"border rounded-lg p-6 space-y-4\">\n <h3 className=\"font-semibold\">{tr('channel.actions', 'Actions')}</h3>\n\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"font-medium\">{tr('channel.deleteConnection', 'Delete Connection')}</p>\n <p className=\"text-sm text-muted-foreground\">\n {tr(\n 'channel.deleteConnectionWarning',\n 'Permanently remove this connection. The channel will become inactive.'\n )}\n </p>\n </div>\n\n {!deleteConfirm ? (\n <PermissionGuard permission={CHANNEL_PERMISSIONS.CHANNEL_CONNECTION_DELETE}>\n <button\n type=\"button\"\n onClick={() => setDeleteConfirm(true)}\n className=\"px-4 py-2 rounded-lg text-destructive border border-destructive hover:bg-destructive/10 transition-colors flex items-center gap-2\"\n >\n <Trash2 className=\"size-4 \" />\n {tr('channel.delete', 'Delete')}\n </button>\n </PermissionGuard>\n ) : (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-muted-foreground\">\n {tr('channel.confirmDelete', 'Confirm delete?')}\n </span>\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={isDeleting}\n className=\"px-4 py-2 rounded-lg bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors flex items-center gap-2\"\n >\n {isDeleting ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Trash2 className=\"size-4 \" />\n )}\n {tr('channel.delete', 'Delete')}\n </button>\n <button\n type=\"button\"\n onClick={() => setDeleteConfirm(false)}\n className=\"px-4 py-2 rounded-lg border hover:bg-muted transition-colors\"\n >\n {tr('channel.cancel', 'Cancel')}\n </button>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,IAAM,IAGF;CACF,MAAM;EACJ,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;EACR;CACD,OAAO;EACL,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;EACR;CACF;AAED,SAAgB,IAAwB;CACtC,I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E,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAG,yBAAyB,kBAAkB;UAC1C,CAAA;SACP,kBAAC,UAAD;UACE,MAAK;UACL,SAAS;UACT,UAAU;UACV,WAAU;oBAJZ,CAMG,IACC,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAE3C,kBAAC,GAAD,EAAQ,WAAU,WAAY,CAAA,EAE/B,EAAG,kBAAkB,SAAS,CACxB;;SACT,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAiB,GAAM;UACtC,WAAU;oBAET,EAAG,kBAAkB,SAAS;UACxB,CAAA;SACL;YAnCN,kBAAC,GAAD;QAAiB,YAAY,EAAoB;kBAC/C,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAiB,GAAK;SACrC,WAAU;mBAHZ,CAKE,kBAAC,GAAD,EAAQ,WAAU,WAAY,CAAA,EAC7B,EAAG,kBAAkB,SAAS,CACxB;;QACO,CAAA,CA4BhB;SACF;;KACF;MACF;;EACU,CAAA"}
1
+ {"version":3,"file":"ConnectionDetailsPage.js","names":[],"sources":["../../../../../src/channel/modules/channels/pages/ConnectionDetailsPage.tsx"],"sourcesContent":["/**\n * Connection Details Page\n *\n * View and manage a specific connection within a channel.\n */\n\nimport { useEffect, useState } from 'react';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { TagBadge } from '@burdenoff/fe-libs/tag';\nimport { reportShellError } from '../../../utils/shellBridge';\nimport { nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport {\n ArrowLeft,\n Loader2,\n AlertCircle,\n CheckCircle2,\n XCircle,\n RefreshCw,\n Trash2,\n Edit,\n Shield,\n Clock,\n} from 'lucide-react';\nimport { useChannel } from '../../../hooks/useChannels';\nimport { useChannel as useChannelContext } from '../../../providers/ChannelProvider';\nimport { getGlobalChannelClient } from '../../../graphql/global-client';\nimport {\n GetConnectionDocument,\n type GetConnectionQuery,\n} from '../../../../generated/global-operations';\nimport { PermissionGuard } from '../../../components/PermissionGuard';\nimport { CHANNEL_PERMISSIONS } from '../../../constants/permissions';\n\nconst HEALTH_CONFIG: Record<\n string,\n { icon: typeof CheckCircle2; color: string; bgColor: string; label: string }\n> = {\n true: {\n icon: CheckCircle2,\n color: 'text-status-success-text',\n bgColor: 'bg-status-success-bg-subtle',\n label: 'Healthy',\n },\n false: {\n icon: XCircle,\n color: 'text-status-error-text',\n bgColor: 'bg-error-500/10',\n label: 'Unhealthy',\n },\n};\n\nexport function ConnectionDetailsPage() {\n const navigate = useNavigate();\n const { hasPermission } = usePermissions();\n const canUpdate = hasPermission(CHANNEL_PERMISSIONS.CHANNEL_UPDATE);\n const params = useParams<{ channelId?: string; connectionId: string }>();\n const { connectionId } = params;\n const { authToken, apiGatewayUrl, organizationId } = useChannelContext();\n\n // Route may be /channels/connections/:connectionId (no channelId in URL).\n // Resolve channelId from getConnection when absent so downstream channel hooks work.\n const [resolvedChannelId, setResolvedChannelId] = useState<string | undefined>(params.channelId);\n const [resolveError, setResolveError] = useState<string | null>(null);\n\n useEffect(() => {\n if (resolvedChannelId || !connectionId) return;\n let cancelled = false;\n void (async () => {\n try {\n const client = getGlobalChannelClient(apiGatewayUrl, authToken, organizationId);\n const result = await client.query<GetConnectionQuery>({\n query: GetConnectionDocument,\n variables: { id: connectionId },\n fetchPolicy: 'network-only',\n });\n if (cancelled) return;\n const conn = result.data?.getConnection;\n if (conn?.channelId) setResolvedChannelId(conn.channelId);\n else setResolveError('Connection not found');\n } catch (err) {\n if (!cancelled)\n setResolveError(err instanceof Error ? err.message : 'Failed to resolve connection');\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [connectionId, resolvedChannelId, apiGatewayUrl, authToken, organizationId]);\n\n const channelId = resolvedChannelId;\n const { channel, isLoading, error, runHealthCheck, deleteConnection } = useChannel(channelId);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n const [isDeleting, setIsDeleting] = useState(false);\n const [isRunningHealth, setIsRunningHealth] = useState(false);\n const [deleteConfirm, setDeleteConfirm] = useState(false);\n\n const connection = channel?.connection;\n\n // Run health check\n const handleRunHealthCheck = async () => {\n setIsRunningHealth(true);\n try {\n await runHealthCheck();\n } finally {\n setIsRunningHealth(false);\n }\n };\n\n // Delete connection\n const handleDelete = async () => {\n if (!connectionId) return;\n void nativeImpact('medium');\n setIsDeleting(true);\n try {\n // deleteConnection throws on failure; success is guaranteed if it returns.\n await deleteConnection(connectionId);\n void nativeNotify('success');\n navigate(`/channels/${channelId}`);\n } catch (err) {\n void nativeNotify('error');\n reportShellError(\n err,\n { module: 'channel', context: { action: 'Failed to delete connection' } },\n '[channel] Failed to delete connection'\n );\n } finally {\n setIsDeleting(false);\n }\n };\n\n if (isLoading || (!resolvedChannelId && !resolveError)) {\n return (\n <div className=\"flex items-center justify-center min-h-screen\">\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (resolveError || error || !channel) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-screen gap-4\">\n <AlertCircle className=\"size-12 text-destructive\" />\n <h1 className=\"text-xl font-semibold\">\n {tr('channel.channelNotFound', 'Channel not found')}\n </h1>\n <button\n type=\"button\"\n onClick={() => navigate('../../list')}\n className=\"text-primary hover:underline\"\n >\n {tr('channel.backToChannels', 'Back to channels')}\n </button>\n </div>\n );\n }\n\n if (!connection) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-screen gap-4\">\n <AlertCircle className=\"size-12 text-muted-foreground\" />\n <h1 className=\"text-xl font-semibold\">\n {tr('channel.noConnectionFound', 'No connection found')}\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {tr(\n 'channel.noConnectionConfigured',\n 'This channel does not have a connection configured.'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigate(`/channels/${channelId}`)}\n className=\"text-primary hover:underline\"\n >\n {tr('channel.backToChannel', 'Back to channel')}\n </button>\n </div>\n );\n }\n\n const health = HEALTH_CONFIG[String(connection.isHealthy)] || HEALTH_CONFIG.false;\n const HealthIcon = health.icon;\n\n return (\n <PermissionGuard permission={CHANNEL_PERMISSIONS.CHANNEL_CONNECTION_READ}>\n <div className=\"min-h-screen bg-background\">\n {/* Header */}\n <div className=\"border-b bg-card\">\n <div className=\"container mx-auto px-6 py-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate(`/channels/${channelId}`)}\n className=\"p-2 hover:bg-muted rounded-lg transition-colors\"\n >\n <ArrowLeft className=\"size-5 \" />\n </button>\n <div>\n <h1 className=\"text-2xl font-bold\">\n {tr('channel.connectionDetails', 'Connection Details')}\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {channel.name} • {channel.platform}\n </p>\n </div>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <PermissionGuard permission={CHANNEL_PERMISSIONS.CHANNEL_EXECUTE}>\n <button\n type=\"button\"\n onClick={handleRunHealthCheck}\n disabled={isRunningHealth}\n className=\"px-4 py-2 rounded-lg border hover:bg-muted transition-colors flex items-center gap-2\"\n >\n {isRunningHealth ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <RefreshCw className=\"size-4 \" />\n )}\n {tr('channel.runHealthCheck', 'Run Health Check')}\n </button>\n </PermissionGuard>\n {canUpdate && (\n <button\n type=\"button\"\n onClick={() => navigate(`/channels/${channelId}/edit`)}\n className=\"px-4 py-2 rounded-lg border hover:bg-muted transition-colors flex items-center gap-2\"\n >\n <Edit className=\"size-4 \" />\n {tr('channel.editChannel', 'Edit Channel')}\n </button>\n )}\n </div>\n </div>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"container mx-auto px-6 py-8 max-w-3xl space-y-6\">\n {/* Health Status */}\n <div className={`p-6 rounded-lg border ${health.bgColor}`}>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <div className={health.color}>\n <HealthIcon className=\"size-10 \" />\n </div>\n <div>\n <h2 className=\"text-xl font-semibold\">{health.label}</h2>\n <p className=\"text-sm text-muted-foreground\">\n {connection.isHealthy\n ? tr('channel.connectionWorking', 'Connection is working properly')\n : tr('channel.connectionNotWorking', 'Connection is not working properly')}\n </p>\n </div>\n </div>\n </div>\n </div>\n\n {/* Connection Info */}\n <div className=\"border rounded-lg p-6 space-y-4\">\n <h3 className=\"font-semibold\">\n {tr('channel.connectionInformation', 'Connection Information')}\n </h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <p className=\"text-sm text-muted-foreground\">Connection ID</p>\n <p className=\"font-mono text-sm\">{connection.id}</p>\n </div>\n\n <div>\n <p className=\"text-sm text-muted-foreground\">Auth Type</p>\n <p className=\"flex items-center gap-2\">\n <Shield className=\"size-4 text-muted-foreground\" />\n {connection.authType}\n </p>\n </div>\n\n <div>\n <p className=\"text-sm text-muted-foreground\">Status</p>\n <p\n className={\n connection.isActive ? 'text-status-success-text' : 'text-muted-foreground'\n }\n >\n {connection.isActive\n ? tr('channel.activeStatus', 'Active')\n : tr('channel.inactiveStatus', 'Inactive')}\n </p>\n </div>\n\n <div>\n <p className=\"text-sm text-muted-foreground\">Token Refresh</p>\n <p\n className={\n connection.needsTokenRefresh\n ? 'text-status-warning-text'\n : 'text-muted-foreground'\n }\n >\n {connection.needsTokenRefresh\n ? tr('channel.tokenRefreshRequired', 'Required soon')\n : tr('channel.tokenRefreshNotNeeded', 'Not needed')}\n </p>\n </div>\n\n {connection.lastTestedAt && (\n <div>\n <p className=\"text-sm text-muted-foreground\">Last Tested</p>\n <p className=\"flex items-center gap-2\">\n <Clock className=\"size-4 text-muted-foreground\" />\n {new Date(connection.lastTestedAt).toLocaleString()}\n </p>\n </div>\n )}\n\n {connection.daysUntilExpiry !== null && connection.daysUntilExpiry !== undefined && (\n <div>\n <p className=\"text-sm text-muted-foreground\">Days Until Token Expiry</p>\n <p\n className={\n connection.daysUntilExpiry < 30\n ? 'text-status-warning-text'\n : 'text-muted-foreground'\n }\n >\n {connection.daysUntilExpiry} days\n </p>\n </div>\n )}\n </div>\n\n {connection.testStatus && (\n <div className=\"pt-4 border-t\">\n <p className=\"text-sm text-muted-foreground mb-2\">Last Test Status</p>\n <div className=\"p-3 rounded-lg bg-muted\">\n <p className=\"font-mono text-sm\">{connection.testStatus}</p>\n </div>\n </div>\n )}\n\n {connection.tagAssignments && connection.tagAssignments.length > 0 && (\n <div className=\"pt-4 border-t\">\n <p className=\"text-sm text-muted-foreground mb-2\">{tr('channel.tags', 'Tags')}</p>\n <div className=\"flex flex-wrap gap-1.5\" aria-label=\"Connection tags\">\n {connection.tagAssignments.map((a) => (\n <TagBadge key={a.id} id={a.tagId} label={a.tagId} size=\"md\" />\n ))}\n </div>\n </div>\n )}\n </div>\n\n {/* Actions */}\n <div className=\"border rounded-lg p-6 space-y-4\">\n <h3 className=\"font-semibold\">{tr('channel.actions', 'Actions')}</h3>\n\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"font-medium\">{tr('channel.deleteConnection', 'Delete Connection')}</p>\n <p className=\"text-sm text-muted-foreground\">\n {tr(\n 'channel.deleteConnectionWarning',\n 'Permanently remove this connection. The channel will become inactive.'\n )}\n </p>\n </div>\n\n {!deleteConfirm ? (\n <PermissionGuard permission={CHANNEL_PERMISSIONS.CHANNEL_CONNECTION_DELETE}>\n <button\n type=\"button\"\n onClick={() => setDeleteConfirm(true)}\n className=\"px-4 py-2 rounded-lg text-destructive border border-destructive hover:bg-destructive/10 transition-colors flex items-center gap-2\"\n >\n <Trash2 className=\"size-4 \" />\n {tr('channel.delete', 'Delete')}\n </button>\n </PermissionGuard>\n ) : (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-muted-foreground\">\n {tr('channel.confirmDelete', 'Confirm delete?')}\n </span>\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={isDeleting}\n className=\"px-4 py-2 rounded-lg bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors flex items-center gap-2\"\n >\n {isDeleting ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Trash2 className=\"size-4 \" />\n )}\n {tr('channel.delete', 'Delete')}\n </button>\n <button\n type=\"button\"\n onClick={() => setDeleteConfirm(false)}\n className=\"px-4 py-2 rounded-lg border hover:bg-muted transition-colors\"\n >\n {tr('channel.cancel', 'Cancel')}\n </button>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmCA,IAAM,IAGF;CACF,MAAM;EACJ,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;EACR;CACD,OAAO;EACL,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;EACR;CACF;AAED,SAAgB,IAAwB;CACtC,IAAM,IAAW,GAAa,EACxB,EAAE,qBAAkB,GAAgB,EACpC,IAAY,EAAc,EAAoB,eAAe,EAC7D,IAAS,GAAyD,EAClE,EAAE,oBAAiB,GACnB,EAAE,cAAW,kBAAe,sBAAmB,GAAmB,EAIlE,CAAC,GAAmB,KAAwB,EAA6B,EAAO,UAAU,EAC1F,CAAC,GAAc,KAAmB,EAAwB,KAAK;AAErE,SAAgB;AACd,MAAI,KAAqB,CAAC,EAAc;EACxC,IAAI,IAAY;AAkBhB,UAjBM,YAAY;AAChB,OAAI;IAEF,IAAM,IAAS,MADA,EAAuB,GAAe,GAAW,EAAe,CACnD,MAA0B;KACpD,OAAO;KACP,WAAW,EAAE,IAAI,GAAc;KAC/B,aAAa;KACd,CAAC;AACF,QAAI,EAAW;IACf,IAAM,IAAO,EAAO,MAAM;AAC1B,IAAI,GAAM,YAAW,EAAqB,EAAK,UAAU,GACpD,EAAgB,uBAAuB;YACrC,GAAK;AACZ,IAAK,KACH,EAAgB,aAAe,QAAQ,EAAI,UAAU,+BAA+B;;MAEtF,QACS;AACX,OAAY;;IAEb;EAAC;EAAc;EAAmB;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