@burdenoff/microfe-channel 2026.526.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 (47) hide show
  1. package/dist/channel/ChannelRoutes.js +5 -6
  2. package/dist/channel/ChannelRoutes.js.map +1 -1
  3. package/dist/channel/components/AdapterCredentialsForm.js +14 -2
  4. package/dist/channel/components/AdapterCredentialsForm.js.map +1 -1
  5. package/dist/channel/components/FeatureNotEnabled.js +1 -1
  6. package/dist/channel/components/FeatureNotEnabled.js.map +1 -1
  7. package/dist/channel/components/PermissionGuard.js +1 -1
  8. package/dist/channel/components/PermissionGuard.js.map +1 -1
  9. package/dist/channel/config/adapterCredentials.js +19 -11
  10. package/dist/channel/config/adapterCredentials.js.map +1 -1
  11. package/dist/channel/constants/permissions.js +3 -0
  12. package/dist/channel/constants/permissions.js.map +1 -1
  13. package/dist/channel/hooks/useChannelSubscription.js.map +1 -1
  14. package/dist/channel/modules/channels/pages/ChannelDashboardPage.js +244 -220
  15. package/dist/channel/modules/channels/pages/ChannelDashboardPage.js.map +1 -1
  16. package/dist/channel/modules/channels/pages/ChannelDetailsPage.js +416 -390
  17. package/dist/channel/modules/channels/pages/ChannelDetailsPage.js.map +1 -1
  18. package/dist/channel/modules/channels/pages/ChannelSettingsPage.js +30 -15
  19. package/dist/channel/modules/channels/pages/ChannelSettingsPage.js.map +1 -1
  20. package/dist/channel/modules/channels/pages/ChannelUsersPage.js +8 -2
  21. package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
  22. package/dist/channel/modules/channels/pages/ChannelsListPage.js +241 -213
  23. package/dist/channel/modules/channels/pages/ChannelsListPage.js.map +1 -1
  24. package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +107 -98
  25. package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
  26. package/dist/channel/modules/channels/pages/ConnectionsListPage.js +160 -140
  27. package/dist/channel/modules/channels/pages/ConnectionsListPage.js.map +1 -1
  28. package/dist/channel/modules/channels/pages/CreateChannelPage.js +47 -50
  29. package/dist/channel/modules/channels/pages/CreateChannelPage.js.map +1 -1
  30. package/dist/channel/modules/channels/pages/CreateConnectionPage.js +16 -5
  31. package/dist/channel/modules/channels/pages/CreateConnectionPage.js.map +1 -1
  32. package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js +11 -4
  33. package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js.map +1 -1
  34. package/dist/channel/modules/channels/pages/EditChannelPage.js +17 -8
  35. package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
  36. package/dist/channel/modules/channels/pages/EditConnectionPage.js +11 -6
  37. package/dist/channel/modules/channels/pages/EditConnectionPage.js.map +1 -1
  38. package/dist/channel/modules/channels/pages/SendMessagePage.js +21 -9
  39. package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
  40. package/dist/channel/modules/channels/pages/WebhookEventsPage.js +8 -1
  41. package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
  42. package/dist/channel/pages/ChannelLandingPage.js +50 -35
  43. package/dist/channel/pages/ChannelLandingPage.js.map +1 -1
  44. package/dist/channel/providers/ChannelProvider.js +1 -1
  45. package/dist/channel/providers/ChannelProvider.js.map +1 -1
  46. package/package.json +2 -2
  47. package/dist/channel/modules/channels/pages/index.js +0 -14
@@ -1,126 +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: "w-8 h-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: "w-12 h-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
- onClick: () => m("../../list"),
97
+ type: "button",
98
+ onClick: () => p("../../list"),
97
99
  className: "text-primary hover:underline",
98
- children: U("channel.backToChannels", "Back to channels")
100
+ children: G("channel.backToChannels", "Back to channels")
99
101
  })
100
102
  ]
101
103
  });
102
- if (!X) return /* @__PURE__ */ T("div", {
104
+ if (!Q) return /* @__PURE__ */ T("div", {
103
105
  className: "flex flex-col items-center justify-center min-h-screen gap-4",
104
106
  children: [
105
- /* @__PURE__ */ w(f, { className: "w-12 h-12 text-muted-foreground" }),
107
+ /* @__PURE__ */ w(d, { className: "size-12 text-muted-foreground" }),
106
108
  /* @__PURE__ */ w("h1", {
107
109
  className: "text-xl font-semibold",
108
- children: U("channel.noConnectionFound", "No connection found")
110
+ children: G("channel.noConnectionFound", "No connection found")
109
111
  }),
110
112
  /* @__PURE__ */ w("p", {
111
113
  className: "text-sm text-muted-foreground",
112
- 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.")
113
115
  }),
114
116
  /* @__PURE__ */ w("button", {
115
- onClick: () => m(`/channels/${I}`),
117
+ type: "button",
118
+ onClick: () => p(`/channels/${R}`),
116
119
  className: "text-primary hover:underline",
117
- children: U("channel.backToChannel", "Back to channel")
120
+ children: G("channel.backToChannel", "Back to channel")
118
121
  })
119
122
  ]
120
123
  });
121
- let $ = D[String(X.isHealthy)] || D.false, ee = $.icon;
122
- return /* @__PURE__ */ w(s, {
123
- 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,
124
127
  children: /* @__PURE__ */ T("div", {
125
128
  className: "min-h-screen bg-background",
126
129
  children: [/* @__PURE__ */ w("div", {
@@ -132,34 +135,37 @@ function O() {
132
135
  children: [/* @__PURE__ */ T("div", {
133
136
  className: "flex items-center gap-4",
134
137
  children: [/* @__PURE__ */ w("button", {
135
- onClick: () => m(`/channels/${I}`),
138
+ type: "button",
139
+ onClick: () => p(`/channels/${R}`),
136
140
  className: "p-2 hover:bg-muted rounded-lg transition-colors",
137
- children: /* @__PURE__ */ w(p, { className: "w-5 h-5" })
141
+ children: /* @__PURE__ */ w(f, { className: "size-5 " })
138
142
  }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h1", {
139
143
  className: "text-2xl font-bold",
140
- children: U("channel.connectionDetails", "Connection Details")
144
+ children: G("channel.connectionDetails", "Connection Details")
141
145
  }), /* @__PURE__ */ T("p", {
142
146
  className: "text-sm text-muted-foreground",
143
147
  children: [
144
- L.name,
148
+ z.name,
145
149
  " • ",
146
- L.platform
150
+ z.platform
147
151
  ]
148
152
  })] })]
149
153
  }), /* @__PURE__ */ T("div", {
150
154
  className: "flex items-center gap-2",
151
- children: [/* @__PURE__ */ w(s, {
152
- permission: c.CHANNEL_EXECUTE,
155
+ children: [/* @__PURE__ */ w(o, {
156
+ permission: s.CHANNEL_EXECUTE,
153
157
  children: /* @__PURE__ */ T("button", {
154
- onClick: Z,
155
- disabled: K,
158
+ type: "button",
159
+ onClick: te,
160
+ disabled: J,
156
161
  className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors flex items-center gap-2",
157
- children: [K ? /* @__PURE__ */ w(_, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ w(v, { className: "w-4 h-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")]
158
163
  })
159
- }), /* @__PURE__ */ T("button", {
160
- onClick: () => m(`/channels/${I}/edit`),
164
+ }), O && /* @__PURE__ */ T("button", {
165
+ type: "button",
166
+ onClick: () => p(`/channels/${R}/edit`),
161
167
  className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors flex items-center gap-2",
162
- children: [/* @__PURE__ */ w(g, { className: "w-4 h-4" }), U("channel.editChannel", "Edit Channel")]
168
+ children: [/* @__PURE__ */ w(h, { className: "size-4 " }), G("channel.editChannel", "Edit Channel")]
163
169
  })]
164
170
  })]
165
171
  })
@@ -175,13 +181,13 @@ function O() {
175
181
  className: "flex items-center gap-4",
176
182
  children: [/* @__PURE__ */ w("div", {
177
183
  className: $.color,
178
- children: /* @__PURE__ */ w(ee, { className: "w-10 h-10" })
184
+ children: /* @__PURE__ */ w(re, { className: "size-10 " })
179
185
  }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h2", {
180
186
  className: "text-xl font-semibold",
181
187
  children: $.label
182
188
  }), /* @__PURE__ */ w("p", {
183
189
  className: "text-sm text-muted-foreground",
184
- 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")
185
191
  })] })]
186
192
  })
187
193
  })
@@ -191,7 +197,7 @@ function O() {
191
197
  children: [
192
198
  /* @__PURE__ */ w("h3", {
193
199
  className: "font-semibold",
194
- children: U("channel.connectionInformation", "Connection Information")
200
+ children: G("channel.connectionInformation", "Connection Information")
195
201
  }),
196
202
  /* @__PURE__ */ T("div", {
197
203
  className: "grid grid-cols-2 gap-4",
@@ -201,46 +207,46 @@ function O() {
201
207
  children: "Connection ID"
202
208
  }), /* @__PURE__ */ w("p", {
203
209
  className: "font-mono text-sm",
204
- children: X.id
210
+ children: Q.id
205
211
  })] }),
206
212
  /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
207
213
  className: "text-sm text-muted-foreground",
208
214
  children: "Auth Type"
209
215
  }), /* @__PURE__ */ T("p", {
210
216
  className: "flex items-center gap-2",
211
- children: [/* @__PURE__ */ w(y, { className: "w-4 h-4 text-muted-foreground" }), X.authType]
217
+ children: [/* @__PURE__ */ w(v, { className: "size-4 text-muted-foreground" }), Q.authType]
212
218
  })] }),
213
219
  /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
214
220
  className: "text-sm text-muted-foreground",
215
221
  children: "Status"
216
222
  }), /* @__PURE__ */ w("p", {
217
- className: X.isActive ? "text-status-success-text" : "text-muted-foreground",
218
- 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")
219
225
  })] }),
220
226
  /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
221
227
  className: "text-sm text-muted-foreground",
222
228
  children: "Token Refresh"
223
229
  }), /* @__PURE__ */ w("p", {
224
- className: X.needsTokenRefresh ? "text-status-warning-text" : "text-muted-foreground",
225
- 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")
226
232
  })] }),
227
- X.lastTestedAt && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
233
+ Q.lastTestedAt && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
228
234
  className: "text-sm text-muted-foreground",
229
235
  children: "Last Tested"
230
236
  }), /* @__PURE__ */ T("p", {
231
237
  className: "flex items-center gap-2",
232
- children: [/* @__PURE__ */ w(h, { className: "w-4 h-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()]
233
239
  })] }),
234
- 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", {
235
241
  className: "text-sm text-muted-foreground",
236
242
  children: "Days Until Token Expiry"
237
243
  }), /* @__PURE__ */ T("p", {
238
- className: X.daysUntilExpiry < 30 ? "text-status-warning-text" : "text-muted-foreground",
239
- children: [X.daysUntilExpiry, " days"]
244
+ className: Q.daysUntilExpiry < 30 ? "text-status-warning-text" : "text-muted-foreground",
245
+ children: [Q.daysUntilExpiry, " days"]
240
246
  })] })
241
247
  ]
242
248
  }),
243
- X.testStatus && /* @__PURE__ */ T("div", {
249
+ Q.testStatus && /* @__PURE__ */ T("div", {
244
250
  className: "pt-4 border-t",
245
251
  children: [/* @__PURE__ */ w("p", {
246
252
  className: "text-sm text-muted-foreground mb-2",
@@ -249,19 +255,19 @@ function O() {
249
255
  className: "p-3 rounded-lg bg-muted",
250
256
  children: /* @__PURE__ */ w("p", {
251
257
  className: "font-mono text-sm",
252
- children: X.testStatus
258
+ children: Q.testStatus
253
259
  })
254
260
  })]
255
261
  }),
256
- X.tagAssignments && X.tagAssignments.length > 0 && /* @__PURE__ */ T("div", {
262
+ Q.tagAssignments && Q.tagAssignments.length > 0 && /* @__PURE__ */ T("div", {
257
263
  className: "pt-4 border-t",
258
264
  children: [/* @__PURE__ */ w("p", {
259
265
  className: "text-sm text-muted-foreground mb-2",
260
- children: U("channel.tags", "Tags")
266
+ children: G("channel.tags", "Tags")
261
267
  }), /* @__PURE__ */ w("div", {
262
268
  className: "flex flex-wrap gap-1.5",
263
269
  "aria-label": "Connection tags",
264
- children: X.tagAssignments.map((e) => /* @__PURE__ */ w(E, {
270
+ children: Q.tagAssignments.map((e) => /* @__PURE__ */ w(E, {
265
271
  id: e.tagId,
266
272
  label: e.tagId,
267
273
  size: "md"
@@ -274,40 +280,43 @@ function O() {
274
280
  className: "border rounded-lg p-6 space-y-4",
275
281
  children: [/* @__PURE__ */ w("h3", {
276
282
  className: "font-semibold",
277
- children: U("channel.actions", "Actions")
283
+ children: G("channel.actions", "Actions")
278
284
  }), /* @__PURE__ */ T("div", {
279
285
  className: "flex items-center justify-between",
280
286
  children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
281
287
  className: "font-medium",
282
- children: U("channel.deleteConnection", "Delete Connection")
288
+ children: G("channel.deleteConnection", "Delete Connection")
283
289
  }), /* @__PURE__ */ w("p", {
284
290
  className: "text-sm text-muted-foreground",
285
- children: U("channel.deleteConnectionWarning", "Permanently remove this connection. The channel will become inactive.")
286
- })] }), J ? /* @__PURE__ */ T("div", {
291
+ children: G("channel.deleteConnectionWarning", "Permanently remove this connection. The channel will become inactive.")
292
+ })] }), X ? /* @__PURE__ */ T("div", {
287
293
  className: "flex items-center gap-2",
288
294
  children: [
289
295
  /* @__PURE__ */ w("span", {
290
296
  className: "text-sm text-muted-foreground",
291
- children: U("channel.confirmDelete", "Confirm delete?")
297
+ children: G("channel.confirmDelete", "Confirm delete?")
292
298
  }),
293
299
  /* @__PURE__ */ T("button", {
294
- onClick: Q,
295
- disabled: W,
300
+ type: "button",
301
+ onClick: ne,
302
+ disabled: K,
296
303
  className: "px-4 py-2 rounded-lg bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors flex items-center gap-2",
297
- children: [W ? /* @__PURE__ */ w(_, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ w(b, { className: "w-4 h-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")]
298
305
  }),
299
306
  /* @__PURE__ */ w("button", {
300
- onClick: () => Y(!1),
307
+ type: "button",
308
+ onClick: () => Z(!1),
301
309
  className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors",
302
- children: U("channel.cancel", "Cancel")
310
+ children: G("channel.cancel", "Cancel")
303
311
  })
304
312
  ]
305
- }) : /* @__PURE__ */ w(s, {
306
- permission: c.CHANNEL_CONNECTION_DELETE,
313
+ }) : /* @__PURE__ */ w(o, {
314
+ permission: s.CHANNEL_CONNECTION_DELETE,
307
315
  children: /* @__PURE__ */ T("button", {
308
- onClick: () => Y(!0),
316
+ type: "button",
317
+ onClick: () => Z(!0),
309
318
  className: "px-4 py-2 rounded-lg text-destructive border border-destructive hover:bg-destructive/10 transition-colors flex items-center gap-2",
310
- children: [/* @__PURE__ */ w(b, { className: "w-4 h-4" }), U("channel.delete", "Delete")]
319
+ children: [/* @__PURE__ */ w(y, { className: "size-4 " }), G("channel.delete", "Delete")]
311
320
  })
312
321
  })]
313
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=\"w-8 h-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=\"w-12 h-12 text-destructive\" />\n <h1 className=\"text-xl font-semibold\">\n {tr('channel.channelNotFound', 'Channel not found')}\n </h1>\n <button onClick={() => navigate('../../list')} className=\"text-primary hover:underline\">\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=\"w-12 h-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 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 onClick={() => navigate(`/channels/${channelId}`)}\n className=\"p-2 hover:bg-muted rounded-lg transition-colors\"\n >\n <ArrowLeft className=\"w-5 h-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 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=\"w-4 h-4 animate-spin\" />\n ) : (\n <RefreshCw className=\"w-4 h-4\" />\n )}\n {tr('channel.runHealthCheck', 'Run Health Check')}\n </button>\n </PermissionGuard>\n <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=\"w-4 h-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=\"w-10 h-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=\"w-4 h-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=\"w-4 h-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 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=\"w-4 h-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 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=\"w-4 h-4 animate-spin\" />\n ) : (\n <Trash2 className=\"w-4 h-4\" />\n )}\n {tr('channel.delete', 'Delete')}\n </button>\n <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,IAAM,IAAW,GAAa,EACxB,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,EAA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;YAhCN,kBAAC,GAAD;QAAiB,YAAY,EAAoB;kBAC/C,kBAAC,UAAD;SACE,eAAe,EAAiB,GAAK;SACrC,WAAU;mBAFZ,CAIE,kBAAC,GAAD,EAAQ,WAAU,WAAY,CAAA,EAC7B,EAAG,kBAAkB,SAAS,CACxB;;QACO,CAAA,CA0BhB;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,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