@burdenoff/microfe-bigconsole 2026.804.2 → 2026.805.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.
@@ -5,44 +5,44 @@ import { newWorkflowPath as n } from "../BigConsoleRoutes.js";
5
5
  import ee from "../components/datasink/DataSinkTableViewer.js";
6
6
  import te from "../hooks/useDataSinkOperations.js";
7
7
  import r from "../components/datasink/DataSinkStatusBadge.js";
8
- import { isNative as i, nativeConfirm as ne, nativeImpact as a, nativeNotify as o } from "../../utils/nativeBridge.js";
9
- import re from "../hooks/useDataSinkSubscription.js";
10
- import ie from "../components/datasink/DataSinkDataViewer.js";
11
- import ae from "../components/datasink/LinkedWorkflowsPanel.js";
12
- import oe from "../components/datasink/LinkedParsersPanel.js";
13
- import se from "../components/datasink/WorkflowStatusPanel.js";
14
- import ce from "../components/datasink/ExportDataSinkDialog.js";
15
- import le from "../components/datasink/ImportDataGuideDialog.js";
16
- import { memo as s, useCallback as c, useEffect as l, useState as u } from "react";
17
- import { useParams as ue } from "react-router";
18
- import { AlertCircle as de, ArrowLeft as d, Code as fe, Database as f, Download as pe, Edit as me, Eye as he, EyeOff as ge, Grid3X3 as p, Loader2 as m, RefreshCw as _e, Trash2 as ve, Upload as h } from "lucide-react";
19
- import { Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, GlassCard as ye, IllustratedEmptyState as be, NextSteps as xe, PagePurpose as Se } from "@burdenoff/fe-libs/ui";
20
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
21
- import { formatDistanceToNow as w } from "date-fns";
8
+ import { isNative as i, nativeConfirm as ne, nativeImpact as re, nativeNotify as a } from "../../utils/nativeBridge.js";
9
+ import ie from "../hooks/useDataSinkSubscription.js";
10
+ import ae from "../components/datasink/DataSinkDataViewer.js";
11
+ import oe from "../components/datasink/LinkedWorkflowsPanel.js";
12
+ import se from "../components/datasink/LinkedParsersPanel.js";
13
+ import ce from "../components/datasink/WorkflowStatusPanel.js";
14
+ import le from "../components/datasink/ExportDataSinkDialog.js";
15
+ import ue from "../components/datasink/ImportDataGuideDialog.js";
16
+ import { memo as o, useCallback as s, useEffect as de, useState as c } from "react";
17
+ import { useParams as fe } from "react-router";
18
+ import { AlertCircle as pe, ArrowLeft as l, Code as me, Database as u, Download as he, Edit as ge, Eye as _e, EyeOff as d, Grid3X3 as ve, Loader2 as f, RefreshCw as ye, Trash2 as be, Upload as p } from "lucide-react";
19
+ import { Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, GlassCard as xe, IllustratedEmptyState as Se, NextSteps as Ce, PagePurpose as we } from "@burdenoff/fe-libs/ui";
20
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
21
+ import { formatDistanceToNow as S } from "date-fns";
22
22
  //#region src/bigconsole/pages/DataSinkViewPage.tsx
23
- var T = s(function() {
24
- let { dataSinkId: s } = ue(), T = t(), [E, D] = u(!1), [O, k] = u(!1), [A, j] = u(!1), [Ce, M] = u(!1), [we, N] = u(!1), [P, Te] = u(null), [F, I] = u(!1), [L, R] = u("table"), [z, Ee] = u(100), [B, De] = u(0), [V, Oe] = u(null), [ke, Ae] = u(!1), H = e((e) => s ? e.dataSinks.get(s) : void 0), { loading: je, error: U, fetchDataSink: W, getDataSinkData: G, refreshDataSink: K, deleteDataSink: q } = te({ skipFetch: !0 });
25
- re({
26
- dataSinkId: s,
27
- enabled: !!s
28
- }), l(() => {
29
- s && W(s);
30
- }, [s, W]);
31
- let J = c(() => {
32
- T("/datasinks");
33
- }, [T]), Me = c(() => {
34
- T(`/datasinks/${s}/edit`);
35
- }, [T, s]), Y = c(async () => {
36
- if (s) {
37
- k(!0);
23
+ var C = o(function() {
24
+ let { dataSinkId: o } = fe(), C = t(), [w, T] = c(!1), [E, D] = c(!1), [O, k] = c(!1), [Te, A] = c(!1), [Ee, j] = c(!1), [M, De] = c(null), [N, P] = c(!1), [F, I] = c("table"), [L, Oe] = c(100), [R, ke] = c(0), [z, Ae] = c(null), [je, Me] = c(!1), B = e((e) => o ? e.dataSinks.get(o) : void 0), { loading: Ne, error: V, fetchDataSink: H, getDataSinkData: U, refreshDataSink: W, updateDataSink: G, deleteDataSink: K } = te({ skipFetch: !0 });
25
+ ie({
26
+ dataSinkId: o,
27
+ enabled: !!o
28
+ }), de(() => {
29
+ o && H(o);
30
+ }, [o, H]);
31
+ let q = s(() => {
32
+ C("/datasinks");
33
+ }, [C]), Pe = s(() => {
34
+ C(`/datasinks/${o}/edit`);
35
+ }, [C, o]), J = s(async () => {
36
+ if (o) {
37
+ D(!0);
38
38
  try {
39
- await K({ id: s });
39
+ await W({ id: o });
40
40
  } catch {} finally {
41
- k(!1);
41
+ D(!1);
42
42
  }
43
43
  }
44
- }, [s, K]), Ne = c(async () => {
45
- if (!s) return;
44
+ }, [o, W]), Fe = s(async () => {
45
+ if (!o) return;
46
46
  let e = await ne({
47
47
  title: "Delete DataSink?",
48
48
  message: "Are you sure you want to delete this DataSink?",
@@ -50,173 +50,188 @@ var T = s(function() {
50
50
  cancelButtonTitle: "Cancel"
51
51
  });
52
52
  if (e === null ? window.confirm("Are you sure you want to delete this DataSink?") : e) {
53
- a("medium"), j(!0);
53
+ re("medium"), k(!0);
54
54
  try {
55
- await q(s), i() && o("success"), T("/datasinks");
55
+ await K(o), i() && a("success"), C("/datasinks");
56
56
  } catch {
57
- i() && o("error");
57
+ i() && a("error");
58
58
  } finally {
59
- j(!1);
59
+ k(!1);
60
60
  }
61
61
  }
62
62
  }, [
63
- s,
64
- q,
65
- T
66
- ]), X = c(async (e, t) => {
67
- if (s) {
68
- I(!0);
63
+ o,
64
+ K,
65
+ C
66
+ ]), Y = s(async (e, t) => {
67
+ if (o) {
68
+ P(!0);
69
69
  try {
70
- let n = await G({ id: s }, {
70
+ let n = await U({ id: o }, {
71
71
  limit: t,
72
72
  offset: e
73
73
  });
74
- n && (Te(n.raw || {}), Oe(typeof n.totalCount == "number" ? n.totalCount : null), Ae(!!n.hasMore), De(e));
74
+ n && (De(n.raw || {}), Ae(typeof n.totalCount == "number" ? n.totalCount : null), Me(!!n.hasMore), ke(e));
75
75
  } catch {} finally {
76
- I(!1);
76
+ P(!1);
77
77
  }
78
78
  }
79
- }, [s, G]), Z = c(async () => {
80
- if (s) {
81
- if (E) {
82
- D(!1);
79
+ }, [o, U]), X = s(async () => {
80
+ if (o) {
81
+ if (w) {
82
+ T(!1);
83
83
  return;
84
84
  }
85
- await X(0, z), D(!0);
85
+ await Y(0, L), T(!0);
86
86
  }
87
87
  }, [
88
- s,
89
- E,
90
- X,
91
- z
92
- ]), Pe = c((e) => {
93
- Ee(e), X(0, e);
94
- }, [X]), Q = c(() => {
95
- M(!0);
96
- }, []), Fe = c(() => {
97
- M(!1);
98
- }, []), $ = c(() => {
99
- N(!0);
100
- }, []), Ie = c(() => {
101
- N(!1);
102
- }, []), Le = c(() => {
103
- N(!1), T(n());
104
- }, [T]);
105
- return je && !H ? /* @__PURE__ */ S("div", {
88
+ o,
89
+ w,
90
+ Y,
91
+ L
92
+ ]), Z = s((e) => {
93
+ Oe(e), Y(0, e);
94
+ }, [Y]), Q = s(() => {
95
+ A(!0);
96
+ }, []), Ie = s(() => {
97
+ A(!1);
98
+ }, []), $ = s(() => {
99
+ j(!0);
100
+ }, []), Le = s(() => {
101
+ j(!1);
102
+ }, []), Re = s(() => {
103
+ j(!1), C(n());
104
+ }, [C]), ze = s(async (e) => {
105
+ if (!B || !await G({
106
+ id: B.id,
107
+ version: B.version,
108
+ data: e
109
+ })) return !1;
110
+ try {
111
+ await Y(0, L), T(!0);
112
+ } catch {}
113
+ return !0;
114
+ }, [
115
+ B,
116
+ G,
117
+ Y,
118
+ L
119
+ ]);
120
+ return Ne && !B ? /* @__PURE__ */ b("div", {
106
121
  className: "flex items-center justify-center min-h-[400px]",
107
- children: /* @__PURE__ */ S(m, { className: "w-8 h-8 text-text-secondary animate-spin" })
108
- }) : U ? /* @__PURE__ */ S("div", {
122
+ children: /* @__PURE__ */ b(f, { className: "w-8 h-8 text-text-secondary animate-spin" })
123
+ }) : V && !B ? /* @__PURE__ */ b("div", {
109
124
  className: "flex items-center justify-center min-h-[400px] p-card-padding",
110
- children: /* @__PURE__ */ C("div", {
125
+ children: /* @__PURE__ */ x("div", {
111
126
  className: "text-center",
112
127
  children: [
113
- /* @__PURE__ */ S(de, { className: "w-12 h-12 text-status-error-text mx-auto mb-4" }),
114
- /* @__PURE__ */ S("p", {
128
+ /* @__PURE__ */ b(pe, { className: "w-12 h-12 text-status-error-text mx-auto mb-4" }),
129
+ /* @__PURE__ */ b("p", {
115
130
  className: "text-status-error-text text-body-sm font-medium mb-2",
116
131
  children: "Failed to load DataSink"
117
132
  }),
118
- /* @__PURE__ */ S("p", {
133
+ /* @__PURE__ */ b("p", {
119
134
  className: "text-text-tertiary text-body-xs mb-6",
120
- children: U.message
135
+ children: V.message
121
136
  }),
122
- /* @__PURE__ */ C(g, {
123
- onClick: J,
137
+ /* @__PURE__ */ x(m, {
138
+ onClick: q,
124
139
  variant: "ghost",
125
140
  size: "sm",
126
- children: [/* @__PURE__ */ S(d, { className: "w-4 h-4 mr-2" }), "Go back"]
141
+ children: [/* @__PURE__ */ b(l, { className: "w-4 h-4 mr-2" }), "Go back"]
127
142
  })
128
143
  ]
129
144
  })
130
- }) : H ? /* @__PURE__ */ C("div", {
145
+ }) : B ? /* @__PURE__ */ x("div", {
131
146
  className: "p-card-padding space-y-6",
132
147
  children: [
133
- /* @__PURE__ */ C("div", {
148
+ /* @__PURE__ */ x("div", {
134
149
  className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",
135
- children: [/* @__PURE__ */ C("div", {
150
+ children: [/* @__PURE__ */ x("div", {
136
151
  className: "flex-1",
137
152
  children: [
138
- /* @__PURE__ */ C(g, {
139
- onClick: J,
153
+ /* @__PURE__ */ x(m, {
154
+ onClick: q,
140
155
  variant: "ghost",
141
156
  size: "sm",
142
157
  className: "mb-4",
143
- children: [/* @__PURE__ */ S(d, { className: "w-4 h-4 mr-2" }), "Back to DataSinks"]
158
+ children: [/* @__PURE__ */ b(l, { className: "w-4 h-4 mr-2" }), "Back to DataSinks"]
144
159
  }),
145
- /* @__PURE__ */ C("div", {
160
+ /* @__PURE__ */ x("div", {
146
161
  className: "flex items-center gap-2 flex-wrap",
147
- children: [/* @__PURE__ */ S("h1", {
162
+ children: [/* @__PURE__ */ b("h1", {
148
163
  className: "text-heading-h1 font-bold text-text-primary",
149
- children: H.name || "Untitled"
150
- }), /* @__PURE__ */ S(r, { status: H.status })]
164
+ children: B.name || "Untitled"
165
+ }), /* @__PURE__ */ b(r, { status: B.status })]
151
166
  }),
152
- /* @__PURE__ */ S("p", {
167
+ /* @__PURE__ */ b("p", {
153
168
  className: "text-body-sm text-text-tertiary font-mono mt-1",
154
- children: H.key
169
+ children: B.key
155
170
  }),
156
- H.description && /* @__PURE__ */ S("p", {
171
+ B.description && /* @__PURE__ */ b("p", {
157
172
  className: "text-body-sm text-text-secondary mt-2",
158
- children: H.description
173
+ children: B.description
159
174
  })
160
175
  ]
161
- }), /* @__PURE__ */ C("div", {
176
+ }), /* @__PURE__ */ x("div", {
162
177
  className: "flex items-center gap-2 flex-wrap",
163
178
  children: [
164
- /* @__PURE__ */ C(g, {
165
- onClick: Y,
166
- disabled: O,
179
+ /* @__PURE__ */ x(m, {
180
+ onClick: J,
181
+ disabled: E,
167
182
  variant: "secondary",
168
183
  size: "default",
169
- children: [/* @__PURE__ */ S(_e, { className: `w-4 h-4 mr-2 ${O ? "animate-spin" : ""}` }), O ? "Refreshing..." : "Refresh"]
184
+ children: [/* @__PURE__ */ b(ye, { className: `w-4 h-4 mr-2 ${E ? "animate-spin" : ""}` }), E ? "Refreshing..." : "Refresh"]
170
185
  }),
171
- /* @__PURE__ */ C(g, {
186
+ /* @__PURE__ */ x(m, {
172
187
  onClick: $,
173
188
  variant: "secondary",
174
189
  size: "default",
175
- children: [/* @__PURE__ */ S(h, { className: "w-4 h-4 mr-2" }), "Import Data"]
190
+ children: [/* @__PURE__ */ b(p, { className: "w-4 h-4 mr-2" }), "Import Data"]
176
191
  }),
177
- /* @__PURE__ */ C(g, {
192
+ /* @__PURE__ */ x(m, {
178
193
  onClick: Q,
179
194
  variant: "secondary",
180
195
  size: "default",
181
- children: [/* @__PURE__ */ S(pe, { className: "w-4 h-4 mr-2" }), "Export"]
196
+ children: [/* @__PURE__ */ b(he, { className: "w-4 h-4 mr-2" }), "Export"]
182
197
  }),
183
- /* @__PURE__ */ C(g, {
184
- onClick: Me,
198
+ /* @__PURE__ */ x(m, {
199
+ onClick: Pe,
185
200
  variant: "secondary",
186
201
  size: "default",
187
- children: [/* @__PURE__ */ S(me, { className: "w-4 h-4 mr-2" }), "Edit"]
202
+ children: [/* @__PURE__ */ b(ge, { className: "w-4 h-4 mr-2" }), "Edit"]
188
203
  }),
189
- /* @__PURE__ */ C(g, {
190
- onClick: Ne,
191
- disabled: A,
204
+ /* @__PURE__ */ x(m, {
205
+ onClick: Fe,
206
+ disabled: O,
192
207
  variant: "destructive",
193
208
  size: "default",
194
- children: [/* @__PURE__ */ S(ve, { className: "w-4 h-4 mr-2" }), A ? "Deleting..." : "Delete"]
209
+ children: [/* @__PURE__ */ b(be, { className: "w-4 h-4 mr-2" }), O ? "Deleting..." : "Delete"]
195
210
  })
196
211
  ]
197
212
  })]
198
213
  }),
199
- /* @__PURE__ */ S(Se, { children: "A data sink is a structured store that holds your processed data and serves it to dashboards. From here you can inspect its schema and stats, preview the cached rows, refresh it from its linked workflow, or export it." }),
200
- /* @__PURE__ */ S(xe, {
214
+ /* @__PURE__ */ b(we, { children: "A data sink is a structured store that holds your processed data and serves it to dashboards. From here you can inspect its schema and stats, preview the cached rows, refresh it from its linked workflow, or export it." }),
215
+ /* @__PURE__ */ b(Ce, {
201
216
  storageKey: "bigconsole-datasink-view",
202
217
  steps: [
203
218
  {
204
219
  id: "preview",
205
220
  label: "Preview the data",
206
221
  description: "Open the cached rows to confirm the sink holds what you expect.",
207
- onClick: Z
222
+ onClick: X
208
223
  },
209
224
  {
210
225
  id: "refresh",
211
226
  label: "Refresh from source",
212
227
  description: "Re-run the linked workflow to pull the latest data.",
213
- onClick: Y
228
+ onClick: J
214
229
  },
215
230
  {
216
231
  id: "build-dashboard",
217
232
  label: "Visualize it on a dashboard",
218
233
  description: "Add widgets that query this sink to see your data live.",
219
- onClick: () => T("/dashboards")
234
+ onClick: () => C("/dashboards")
220
235
  },
221
236
  {
222
237
  id: "export",
@@ -226,225 +241,227 @@ var T = s(function() {
226
241
  }
227
242
  ]
228
243
  }),
229
- /* @__PURE__ */ C("div", {
244
+ /* @__PURE__ */ x("div", {
230
245
  className: "grid gap-6 md:grid-cols-2",
231
246
  children: [
232
- /* @__PURE__ */ C(ye, {
247
+ /* @__PURE__ */ x(xe, {
233
248
  treatment: "glass",
234
249
  glow: !0,
235
- children: [/* @__PURE__ */ S(y, { children: /* @__PURE__ */ S(b, { children: "Details" }) }), /* @__PURE__ */ S(v, { children: /* @__PURE__ */ C("dl", {
250
+ children: [/* @__PURE__ */ b(_, { children: /* @__PURE__ */ b(v, { children: "Details" }) }), /* @__PURE__ */ b(g, { children: /* @__PURE__ */ x("dl", {
236
251
  className: "space-y-4 text-body-sm",
237
252
  children: [
238
- /* @__PURE__ */ C("div", {
253
+ /* @__PURE__ */ x("div", {
239
254
  className: "flex justify-between items-center",
240
- children: [/* @__PURE__ */ S("dt", {
255
+ children: [/* @__PURE__ */ b("dt", {
241
256
  className: "text-text-secondary",
242
257
  children: "Status"
243
- }), /* @__PURE__ */ S("dd", { children: /* @__PURE__ */ S(r, { status: H.status }) })]
258
+ }), /* @__PURE__ */ b("dd", { children: /* @__PURE__ */ b(r, { status: B.status }) })]
244
259
  }),
245
- /* @__PURE__ */ C("div", {
260
+ /* @__PURE__ */ x("div", {
246
261
  className: "flex justify-between items-center",
247
- children: [/* @__PURE__ */ S("dt", {
262
+ children: [/* @__PURE__ */ b("dt", {
248
263
  className: "text-text-secondary",
249
264
  children: "Cache TTL"
250
- }), /* @__PURE__ */ S("dd", {
265
+ }), /* @__PURE__ */ b("dd", {
251
266
  className: "text-text-primary font-medium",
252
- children: H.ttl ? `${H.ttl}s` : "None"
267
+ children: B.ttl ? `${B.ttl}s` : "None"
253
268
  })]
254
269
  }),
255
- /* @__PURE__ */ C("div", {
270
+ /* @__PURE__ */ x("div", {
256
271
  className: "flex justify-between items-center",
257
- children: [/* @__PURE__ */ S("dt", {
272
+ children: [/* @__PURE__ */ b("dt", {
258
273
  className: "text-text-secondary",
259
274
  children: "Refresh Type"
260
- }), /* @__PURE__ */ S("dd", {
275
+ }), /* @__PURE__ */ b("dd", {
261
276
  className: "text-text-primary font-medium capitalize",
262
- children: H.refresh?.type || "Manual"
277
+ children: B.refresh?.type || "Manual"
263
278
  })]
264
279
  }),
265
- /* @__PURE__ */ C("div", {
280
+ /* @__PURE__ */ x("div", {
266
281
  className: "flex justify-between items-center",
267
- children: [/* @__PURE__ */ S("dt", {
282
+ children: [/* @__PURE__ */ b("dt", {
268
283
  className: "text-text-secondary",
269
284
  children: "Size"
270
- }), /* @__PURE__ */ S("dd", {
285
+ }), /* @__PURE__ */ b("dd", {
271
286
  className: "text-text-primary font-medium",
272
- children: H.sizeBytes ? `${(H.sizeBytes / 1024).toFixed(2)} KB` : "0 KB"
287
+ children: B.sizeBytes ? `${(B.sizeBytes / 1024).toFixed(2)} KB` : "0 KB"
273
288
  })]
274
289
  }),
275
- /* @__PURE__ */ C("div", {
290
+ /* @__PURE__ */ x("div", {
276
291
  className: "flex justify-between items-center",
277
- children: [/* @__PURE__ */ S("dt", {
292
+ children: [/* @__PURE__ */ b("dt", {
278
293
  className: "text-text-secondary",
279
294
  children: "Version"
280
- }), /* @__PURE__ */ S("dd", {
295
+ }), /* @__PURE__ */ b("dd", {
281
296
  className: "text-text-primary font-medium",
282
- children: H.version || 1
297
+ children: B.version || 1
283
298
  })]
284
299
  }),
285
- /* @__PURE__ */ C("div", {
300
+ /* @__PURE__ */ x("div", {
286
301
  className: "flex justify-between items-center",
287
- children: [/* @__PURE__ */ S("dt", {
302
+ children: [/* @__PURE__ */ b("dt", {
288
303
  className: "text-text-secondary",
289
304
  children: "Last Refreshed"
290
- }), /* @__PURE__ */ S("dd", {
305
+ }), /* @__PURE__ */ b("dd", {
291
306
  className: "text-text-primary font-medium",
292
- children: H.lastRefreshedAt ? w(new Date(H.lastRefreshedAt), { addSuffix: !0 }) : "Never"
307
+ children: B.lastRefreshedAt ? S(new Date(B.lastRefreshedAt), { addSuffix: !0 }) : "Never"
293
308
  })]
294
309
  }),
295
- /* @__PURE__ */ C("div", {
310
+ /* @__PURE__ */ x("div", {
296
311
  className: "flex justify-between items-center",
297
- children: [/* @__PURE__ */ S("dt", {
312
+ children: [/* @__PURE__ */ b("dt", {
298
313
  className: "text-text-secondary",
299
314
  children: "Created"
300
- }), /* @__PURE__ */ S("dd", {
315
+ }), /* @__PURE__ */ b("dd", {
301
316
  className: "text-text-primary font-medium",
302
- children: w(new Date(H.createdAt), { addSuffix: !0 })
317
+ children: S(new Date(B.createdAt), { addSuffix: !0 })
303
318
  })]
304
319
  })
305
320
  ]
306
321
  }) })]
307
322
  }),
308
- H.fluidGridsWorkflowId && /* @__PURE__ */ S(se, {
309
- workflowId: H.fluidGridsWorkflowId,
310
- executionId: H.fluidGridsWorkflowExecutionId || void 0,
311
- lastRefreshedAt: H.lastRefreshedAt || void 0,
312
- setupState: H.setupState,
313
- status: H.status,
314
- onRerunWorkflow: Y,
315
- disabled: O,
316
- isRerunning: O
323
+ B.fluidGridsWorkflowId && /* @__PURE__ */ b(ce, {
324
+ workflowId: B.fluidGridsWorkflowId,
325
+ executionId: B.fluidGridsWorkflowExecutionId || void 0,
326
+ lastRefreshedAt: B.lastRefreshedAt || void 0,
327
+ setupState: B.setupState,
328
+ status: B.status,
329
+ onRerunWorkflow: J,
330
+ disabled: E,
331
+ isRerunning: E
317
332
  }),
318
- /* @__PURE__ */ S(ae, { workflowLinks: H.workflowLinks }),
319
- /* @__PURE__ */ S(oe, { dataSinkKey: H.key })
333
+ /* @__PURE__ */ b(oe, { workflowLinks: B.workflowLinks }),
334
+ /* @__PURE__ */ b(se, { dataSinkKey: B.key })
320
335
  ]
321
336
  }),
322
- /* @__PURE__ */ C(_, { children: [
323
- /* @__PURE__ */ C(y, {
337
+ /* @__PURE__ */ x(h, { children: [
338
+ /* @__PURE__ */ x(_, {
324
339
  className: "flex flex-row items-center justify-between space-y-0",
325
- children: [/* @__PURE__ */ C(b, {
340
+ children: [/* @__PURE__ */ x(v, {
326
341
  className: "flex items-center gap-2",
327
- children: [/* @__PURE__ */ S(f, { className: "w-4 h-4 text-text-secondary" }), "Data Preview"]
328
- }), /* @__PURE__ */ C("div", {
342
+ children: [/* @__PURE__ */ b(u, { className: "w-4 h-4 text-text-secondary" }), "Data Preview"]
343
+ }), /* @__PURE__ */ x("div", {
329
344
  className: "flex items-center gap-2",
330
- children: [E && /* @__PURE__ */ C("div", {
345
+ children: [w && /* @__PURE__ */ x("div", {
331
346
  className: "flex items-center border border-border-default rounded-md overflow-hidden",
332
- children: [/* @__PURE__ */ S("button", {
347
+ children: [/* @__PURE__ */ b("button", {
333
348
  type: "button",
334
- onClick: () => R("table"),
335
- className: `p-1.5 ${L === "table" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
349
+ onClick: () => I("table"),
350
+ className: `p-1.5 ${F === "table" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
336
351
  title: "Table view",
337
- children: /* @__PURE__ */ S(p, { className: "w-4 h-4" })
338
- }), /* @__PURE__ */ S("button", {
352
+ children: /* @__PURE__ */ b(ve, { className: "w-4 h-4" })
353
+ }), /* @__PURE__ */ b("button", {
339
354
  type: "button",
340
- onClick: () => R("json"),
341
- className: `p-1.5 ${L === "json" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
355
+ onClick: () => I("json"),
356
+ className: `p-1.5 ${F === "json" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
342
357
  title: "JSON view",
343
- children: /* @__PURE__ */ S(fe, { className: "w-4 h-4" })
358
+ children: /* @__PURE__ */ b(me, { className: "w-4 h-4" })
344
359
  })]
345
- }), /* @__PURE__ */ S(g, {
346
- onClick: Z,
347
- disabled: F,
348
- variant: E ? "secondary" : "default",
360
+ }), /* @__PURE__ */ b(m, {
361
+ onClick: X,
362
+ disabled: N,
363
+ variant: w ? "secondary" : "default",
349
364
  size: "sm",
350
- children: F ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(m, { className: "w-4 h-4 mr-2 animate-spin" }), "Loading..."] }) : E ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(ge, { className: "w-4 h-4 mr-2" }), "Hide Data"] }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(he, { className: "w-4 h-4 mr-2" }), "Show Data"] })
365
+ children: N ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(f, { className: "w-4 h-4 mr-2 animate-spin" }), "Loading..."] }) : w ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(d, { className: "w-4 h-4 mr-2" }), "Hide Data"] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_e, { className: "w-4 h-4 mr-2" }), "Show Data"] })
351
366
  })]
352
367
  })]
353
368
  }),
354
- E && P && /* @__PURE__ */ C(v, { children: [S(L === "table" ? ee : ie, {
355
- data: P,
369
+ w && M && /* @__PURE__ */ x(g, { children: [b(F === "table" ? ee : ae, {
370
+ data: M,
356
371
  maxHeight: "400px"
357
- }), V !== null && /* @__PURE__ */ C("div", {
372
+ }), z !== null && /* @__PURE__ */ x("div", {
358
373
  className: "flex items-center justify-between gap-4 mt-4 pt-4 border-t border-border-subtle",
359
- children: [/* @__PURE__ */ C("div", {
374
+ children: [/* @__PURE__ */ x("div", {
360
375
  className: "flex items-center gap-2 text-body-sm text-text-secondary",
361
- children: [/* @__PURE__ */ S("span", { children: "Rows per page" }), /* @__PURE__ */ S("select", {
376
+ children: [/* @__PURE__ */ b("span", { children: "Rows per page" }), /* @__PURE__ */ b("select", {
362
377
  "aria-label": "Rows per page",
363
378
  className: "bg-bg-canvas border border-border-default rounded px-2 py-0.5 text-text-primary",
364
- value: z,
365
- onChange: (e) => Pe(Number(e.target.value)),
379
+ value: L,
380
+ onChange: (e) => Z(Number(e.target.value)),
366
381
  children: [
367
382
  100,
368
383
  500,
369
384
  1e3
370
- ].map((e) => /* @__PURE__ */ S("option", {
385
+ ].map((e) => /* @__PURE__ */ b("option", {
371
386
  value: e,
372
387
  children: e
373
388
  }, e))
374
389
  })]
375
- }), /* @__PURE__ */ C("div", {
390
+ }), /* @__PURE__ */ x("div", {
376
391
  className: "flex items-center gap-4 text-body-sm text-text-secondary",
377
392
  children: [
378
- /* @__PURE__ */ S("span", { children: V === 0 ? "0 rows" : `${B + 1}–${Math.min(B + z, V)} of ${V}` }),
379
- /* @__PURE__ */ S(g, {
393
+ /* @__PURE__ */ b("span", { children: z === 0 ? "0 rows" : `${R + 1}–${Math.min(R + L, z)} of ${z}` }),
394
+ /* @__PURE__ */ b(m, {
380
395
  variant: "secondary",
381
396
  size: "sm",
382
- disabled: B === 0 || F,
383
- onClick: () => void X(Math.max(0, B - z), z),
397
+ disabled: R === 0 || N,
398
+ onClick: () => void Y(Math.max(0, R - L), L),
384
399
  children: "Previous"
385
400
  }),
386
- /* @__PURE__ */ S(g, {
401
+ /* @__PURE__ */ b(m, {
387
402
  variant: "secondary",
388
403
  size: "sm",
389
- disabled: !ke || F,
390
- onClick: () => void X(B + z, z),
404
+ disabled: !je || N,
405
+ onClick: () => void Y(R + L, L),
391
406
  children: "Next"
392
407
  })
393
408
  ]
394
409
  })]
395
410
  })] }),
396
- !E && (H.data && Object.keys(H.data).length > 0 ? /* @__PURE__ */ C(v, {
411
+ !w && (B.data && Object.keys(B.data).length > 0 ? /* @__PURE__ */ x(g, {
397
412
  className: "text-center p-8",
398
- children: [/* @__PURE__ */ S(f, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }), /* @__PURE__ */ S("p", {
413
+ children: [/* @__PURE__ */ b(u, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }), /* @__PURE__ */ b("p", {
399
414
  className: "text-body-sm text-text-secondary",
400
415
  children: "Click \"Show Data\" to preview the cached data."
401
416
  })]
402
- }) : /* @__PURE__ */ C(v, {
417
+ }) : /* @__PURE__ */ x(g, {
403
418
  className: "text-center p-8",
404
419
  children: [
405
- /* @__PURE__ */ S(f, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }),
406
- /* @__PURE__ */ S("p", {
420
+ /* @__PURE__ */ b(u, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }),
421
+ /* @__PURE__ */ b("p", {
407
422
  className: "text-body-sm text-text-secondary mb-4",
408
- children: "This data sink has no data yet. Import data by building a workflow."
423
+ children: "This data sink has no data yet. Upload a CSV or build a workflow to import data."
409
424
  }),
410
- /* @__PURE__ */ C(g, {
425
+ /* @__PURE__ */ x(m, {
411
426
  onClick: $,
412
427
  variant: "default",
413
428
  size: "sm",
414
- children: [/* @__PURE__ */ S(h, { className: "w-4 h-4 mr-2" }), "Import Data"]
429
+ children: [/* @__PURE__ */ b(p, { className: "w-4 h-4 mr-2" }), "Import Data"]
415
430
  })
416
431
  ]
417
432
  }))
418
433
  ] }),
419
- /* @__PURE__ */ S(ce, {
420
- isOpen: Ce,
421
- dataSinkId: s || null,
422
- dataSinkName: H.name || H.key,
423
- onClose: Fe
434
+ /* @__PURE__ */ b(le, {
435
+ isOpen: Te,
436
+ dataSinkId: o || null,
437
+ dataSinkName: B.name || B.key,
438
+ onClose: Ie
424
439
  }),
425
- /* @__PURE__ */ S(le, {
426
- isOpen: we,
427
- dataSinkName: H.name || H.key,
428
- onClose: Ie,
429
- onGoToWorkflows: Le
440
+ /* @__PURE__ */ b(ue, {
441
+ isOpen: Ee,
442
+ dataSinkName: B.name || B.key,
443
+ hasExistingData: !!(B.data && Object.keys(B.data).length > 0),
444
+ onClose: Le,
445
+ onGoToWorkflows: Re,
446
+ onImportCsv: ze
430
447
  })
431
448
  ]
432
- }) : /* @__PURE__ */ S("div", {
449
+ }) : /* @__PURE__ */ b("div", {
433
450
  className: "flex items-center justify-center min-h-[400px] p-card-padding",
434
- children: /* @__PURE__ */ S(be, {
451
+ children: /* @__PURE__ */ b(Se, {
435
452
  illustration: "empty-data",
436
453
  title: "DataSink not found",
437
454
  description: "The DataSink you're looking for doesn't exist or has been deleted.",
438
- action: /* @__PURE__ */ C(g, {
439
- onClick: J,
455
+ action: /* @__PURE__ */ x(m, {
456
+ onClick: q,
440
457
  variant: "default",
441
458
  size: "default",
442
- children: [/* @__PURE__ */ S(d, { className: "w-4 h-4 mr-2" }), "Go back to DataSinks"]
459
+ children: [/* @__PURE__ */ b(l, { className: "w-4 h-4 mr-2" }), "Go back to DataSinks"]
443
460
  })
444
461
  })
445
462
  });
446
463
  });
447
464
  //#endregion
448
- export { T as DataSinkViewPage, T as default };
465
+ export { C as DataSinkViewPage, C as default };
449
466
 
450
467
  //# sourceMappingURL=DataSinkViewPage.js.map