@burdenoff/microfe-export 2026.518.2 → 2026.519.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportRoot.d.ts","sourceRoot":"","sources":["../../src/export/ExportRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ExportRoot.d.ts","sourceRoot":"","sources":["../../src/export/ExportRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAW,eAAe,EAAE,MAAM,SAAS,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAiG1C,CAAC"}
|
|
@@ -3,68 +3,73 @@ import { ExportRoutes as t } from "./ExportRoutes.js";
|
|
|
3
3
|
import { useEffect as n } from "react";
|
|
4
4
|
import { Clock as r, Download as i, FileBox as a, Plus as o } from "lucide-react";
|
|
5
5
|
import { FeatureFlagProvider as s } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
6
|
-
import {
|
|
6
|
+
import { PermissionProvider as c } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
7
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
7
8
|
//#region src/export/ExportRoot.tsx
|
|
8
|
-
var
|
|
9
|
-
let { registerNavItems:
|
|
9
|
+
var u = (u) => {
|
|
10
|
+
let { registerNavItems: d, registerFooterItems: f, basePath: p = "/", workspaceId: m } = u, h = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
10
11
|
return n(() => {
|
|
11
|
-
if (
|
|
12
|
+
if (d) return d({
|
|
12
13
|
id: "export",
|
|
13
14
|
label: "Export",
|
|
14
|
-
path:
|
|
15
|
-
icon: /* @__PURE__ */
|
|
15
|
+
path: p,
|
|
16
|
+
icon: /* @__PURE__ */ l(i, { size: 20 }),
|
|
16
17
|
order: 75,
|
|
17
18
|
group: "workspace",
|
|
18
19
|
children: [
|
|
19
20
|
{
|
|
20
21
|
id: "export-dashboard",
|
|
21
22
|
label: "Dashboard",
|
|
22
|
-
path:
|
|
23
|
-
icon: /* @__PURE__ */
|
|
23
|
+
path: p,
|
|
24
|
+
icon: /* @__PURE__ */ l(a, { size: 16 }),
|
|
24
25
|
order: 10
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
id: "export-new",
|
|
28
29
|
label: "New Export",
|
|
29
|
-
path:
|
|
30
|
-
icon: /* @__PURE__ */
|
|
30
|
+
path: h(p, "new"),
|
|
31
|
+
icon: /* @__PURE__ */ l(o, { size: 16 }),
|
|
31
32
|
order: 20
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
35
|
id: "export-history",
|
|
35
36
|
label: "History",
|
|
36
|
-
path:
|
|
37
|
-
icon: /* @__PURE__ */
|
|
37
|
+
path: h(p, "history"),
|
|
38
|
+
icon: /* @__PURE__ */ l(r, { size: 16 }),
|
|
38
39
|
order: 30
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
id: "export-templates",
|
|
42
43
|
label: "Templates",
|
|
43
|
-
path:
|
|
44
|
-
icon: /* @__PURE__ */
|
|
44
|
+
path: h(p, "templates"),
|
|
45
|
+
icon: /* @__PURE__ */ l(a, { size: 16 }),
|
|
45
46
|
order: 40
|
|
46
47
|
}
|
|
47
48
|
]
|
|
48
49
|
});
|
|
49
|
-
}, [
|
|
50
|
-
if (
|
|
50
|
+
}, [d, p]), n(() => {
|
|
51
|
+
if (f) return f([{
|
|
51
52
|
id: "export-status",
|
|
52
53
|
label: "Export Ready",
|
|
53
54
|
type: "status",
|
|
54
55
|
order: 10,
|
|
55
56
|
section: "left"
|
|
56
57
|
}]);
|
|
57
|
-
}, [
|
|
58
|
-
workspaceId:
|
|
58
|
+
}, [f]), /* @__PURE__ */ l(s, {
|
|
59
|
+
workspaceId: m ?? null,
|
|
59
60
|
gateway: "global",
|
|
60
61
|
defaultEnabled: !0,
|
|
61
|
-
children: /* @__PURE__ */ c
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
children: /* @__PURE__ */ l(c, {
|
|
63
|
+
scopeId: m ?? null,
|
|
64
|
+
gateway: "workspace",
|
|
65
|
+
children: /* @__PURE__ */ l(e, {
|
|
66
|
+
...u,
|
|
67
|
+
children: /* @__PURE__ */ l(t, {})
|
|
68
|
+
})
|
|
64
69
|
})
|
|
65
70
|
});
|
|
66
71
|
};
|
|
67
72
|
//#endregion
|
|
68
|
-
export {
|
|
73
|
+
export { u as ExportRoot };
|
|
69
74
|
|
|
70
75
|
//# sourceMappingURL=ExportRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportRoot.js","names":[],"sources":["../../src/export/ExportRoot.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect } from \"react\";\nimport { Download, Plus, Clock, FileBox } from \"lucide-react\";\nimport { FeatureFlagProvider } from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { ExportProvider } from \"./providers/ExportProvider\";\nimport type { NavItem, ExportRootProps } from \"./types\";\nimport { ExportRoutes } from \"./ExportRoutes\";\n\n/**\n * Root component for the Export microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { ExportRoot, type ExportRootProps } from '@burdenoff/micro-fe/export';\n *\n * function App() {\n * const props: ExportRootProps = {\n * basePath: '/export',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <ExportRoot {...props} />;\n * }\n * ```\n */\nexport const ExportRoot: FC<ExportRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = \"/\",\n workspaceId,\n } = props;\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n // Create a parent \"Export\" item with children for dropdown behavior\n const exportNavItem: NavItem = {\n id: \"export\",\n label: \"Export\",\n path: basePath,\n icon: <Download size={20} />,\n order: 75,\n group: \"workspace\",\n children: [\n {\n id: \"export-dashboard\",\n label: \"Dashboard\",\n path: basePath,\n icon: <FileBox size={16} />,\n order: 10,\n },\n {\n id: \"export-new\",\n label: \"New Export\",\n path: joinPath(basePath, \"new\"),\n icon: <Plus size={16} />,\n order: 20,\n },\n {\n id: \"export-history\",\n label: \"History\",\n path: joinPath(basePath, \"history\"),\n icon: <Clock size={16} />,\n order: 30,\n },\n {\n id: \"export-templates\",\n label: \"Templates\",\n path: joinPath(basePath, \"templates\"),\n icon: <FileBox size={16} />,\n order: 40,\n },\n ],\n };\n\n // Register and get cleanup function\n const cleanup = registerNavItems(exportNavItem);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: \"export-status\",\n label: \"Export Ready\",\n type: \"status\" as const,\n order: 10,\n section: \"left\" as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n return (\n <FeatureFlagProvider\n workspaceId={workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <ExportProvider {...props}>\n
|
|
1
|
+
{"version":3,"file":"ExportRoot.js","names":[],"sources":["../../src/export/ExportRoot.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect } from \"react\";\nimport { Download, Plus, Clock, FileBox } from \"lucide-react\";\nimport { FeatureFlagProvider } from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { PermissionProvider } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport { ExportProvider } from \"./providers/ExportProvider\";\nimport type { NavItem, ExportRootProps } from \"./types\";\nimport { ExportRoutes } from \"./ExportRoutes\";\n\n/**\n * Root component for the Export microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { ExportRoot, type ExportRootProps } from '@burdenoff/micro-fe/export';\n *\n * function App() {\n * const props: ExportRootProps = {\n * basePath: '/export',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <ExportRoot {...props} />;\n * }\n * ```\n */\nexport const ExportRoot: FC<ExportRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = \"/\",\n workspaceId,\n } = props;\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n // Create a parent \"Export\" item with children for dropdown behavior\n const exportNavItem: NavItem = {\n id: \"export\",\n label: \"Export\",\n path: basePath,\n icon: <Download size={20} />,\n order: 75,\n group: \"workspace\",\n children: [\n {\n id: \"export-dashboard\",\n label: \"Dashboard\",\n path: basePath,\n icon: <FileBox size={16} />,\n order: 10,\n },\n {\n id: \"export-new\",\n label: \"New Export\",\n path: joinPath(basePath, \"new\"),\n icon: <Plus size={16} />,\n order: 20,\n },\n {\n id: \"export-history\",\n label: \"History\",\n path: joinPath(basePath, \"history\"),\n icon: <Clock size={16} />,\n order: 30,\n },\n {\n id: \"export-templates\",\n label: \"Templates\",\n path: joinPath(basePath, \"templates\"),\n icon: <FileBox size={16} />,\n order: 40,\n },\n ],\n };\n\n // Register and get cleanup function\n const cleanup = registerNavItems(exportNavItem);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: \"export-status\",\n label: \"Export Ready\",\n type: \"status\" as const,\n order: 10,\n section: \"left\" as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n return (\n <FeatureFlagProvider\n workspaceId={workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <PermissionProvider scopeId={workspaceId ?? null} gateway=\"workspace\">\n <ExportProvider {...props}>\n <ExportRoutes />\n </ExportProvider>\n </PermissionProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;AAmCA,IAAa,KAAmC,MAAU;CACxD,IAAM,EACJ,qBACA,wBACA,cAAW,KACX,mBACE,GAGE,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AAyEtD,QApEA,QAAgB;AACT,QA8CL,QAHgB,EAxCe;GAC7B,IAAI;GACJ,OAAO;GACP,MAAM;GACN,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;GAC5B,OAAO;GACP,OAAO;GACP,UAAU;IACR;KACE,IAAI;KACJ,OAAO;KACP,MAAM;KACN,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;KAC3B,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO;KACP,MAAM,EAAS,GAAU,MAAM;KAC/B,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;KACxB,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO;KACP,MAAM,EAAS,GAAU,UAAU;KACnC,MAAM,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;KACzB,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO;KACP,MAAM,EAAS,GAAU,YAAY;KACrC,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;KAC3B,OAAO;KACR;IACF;GACF,CAG8C;IAI9C,CAAC,GAAkB,EAAS,CAAC,EAGhC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO;GACP,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,EAAoB,CAAC,EAGvB,kBAAC,GAAD;EACE,aAAa,KAAe;EAC5B,SAAQ;EACR,gBAAgB;YAEhB,kBAAC,GAAD;GAAoB,SAAS,KAAe;GAAM,SAAQ;aACxD,kBAAC,GAAD;IAAgB,GAAI;cAClB,kBAAC,GAAD,EAAgB,CAAA;IACD,CAAA;GACE,CAAA;EACD,CAAA"}
|
|
@@ -4,12 +4,12 @@ import { cn as i } from "../utils/cn.js";
|
|
|
4
4
|
import { getFormatDisplayName as a } from "../constants/enums.js";
|
|
5
5
|
import { tWithFallback as o } from "../utils/i18n.js";
|
|
6
6
|
import { PageLayout as ee } from "../components/PageLayout.js";
|
|
7
|
-
import { useEffect as
|
|
7
|
+
import { useEffect as te, useRef as s, useState as c } from "react";
|
|
8
8
|
import { ArrowLeft as l, ArrowRight as u, Building2 as d, CalendarRange as ne, CheckCircle2 as f, Download as p, FileJson as m, FileSpreadsheet as h, Loader2 as g, Lock as _, Package as re, User as v, Users as y } from "lucide-react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { usePermission as b } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
|
+
import { useSearchParams as x } from "react-router-dom";
|
|
11
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
12
|
+
import { useI18n as w } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
13
|
//#region src/export/pages/CreateExportPage.tsx
|
|
14
14
|
var T = ["CSV", "JSON"], ie = {
|
|
15
15
|
CSV: h,
|
|
@@ -35,8 +35,8 @@ var T = ["CSV", "JSON"], ie = {
|
|
|
35
35
|
}
|
|
36
36
|
];
|
|
37
37
|
function E() {
|
|
38
|
-
let { basePath: d = "/", navigate: m, organizationId: h } = e(), { t: v } =
|
|
39
|
-
|
|
38
|
+
let { basePath: d = "/", navigate: m, organizationId: h } = e(), { t: v } = w(), y = (e, t, n) => o(v, e, t, n), { createJob: E, isPending: D } = n(), { data: O } = t(), { data: k } = r(), [A] = x(), j = b("export:workspace:admin"), oe = b("export:org:admin"), [M, N] = c("entities"), [P, F] = c([]), [I, L] = c(""), [R, z] = c("CSV"), [B, V] = c("INDIVIDUAL"), [H, U] = c(A.get("templateId") ?? void 0), [W, G] = c(""), [K, se] = c(""), [q, J] = c(null), Y = s(null);
|
|
39
|
+
te(() => {
|
|
40
40
|
let e = A.get("templateId");
|
|
41
41
|
if (!e || !k?.length || Y.current === e) return;
|
|
42
42
|
let t = k.find((t) => t.id === e);
|
|
@@ -126,97 +126,97 @@ function E() {
|
|
|
126
126
|
description: y("export.create.entities.calendar.description", "Events and bookings")
|
|
127
127
|
}
|
|
128
128
|
}, $ = O.filter((e) => e.enabled !== !1);
|
|
129
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ C(ee, {
|
|
130
130
|
showHeader: !1,
|
|
131
131
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ S("div", {
|
|
133
133
|
className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm",
|
|
134
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ C("div", {
|
|
135
135
|
className: "relative z-10 flex items-center gap-4",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ S("button", {
|
|
137
137
|
onClick: () => m?.(d),
|
|
138
138
|
className: "p-2.5 hover:bg-accent rounded-lg transition-all duration-200 hover:scale-110",
|
|
139
139
|
"aria-label": y("export.create.actions.backToDashboard", "Back to export dashboard"),
|
|
140
|
-
children: /* @__PURE__ */
|
|
141
|
-
}), /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ S(l, { size: 20 })
|
|
141
|
+
}), /* @__PURE__ */ C("div", {
|
|
142
142
|
className: "flex items-center gap-3",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ S("div", {
|
|
144
144
|
className: "p-2.5 rounded-lg bg-primary/10 backdrop-blur-sm",
|
|
145
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ S(p, {
|
|
146
146
|
size: 24,
|
|
147
147
|
className: "text-primary"
|
|
148
148
|
})
|
|
149
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ S("h1", {
|
|
150
150
|
className: "text-2xl sm:text-3xl font-bold",
|
|
151
151
|
children: y("export.create.title", "New Export")
|
|
152
152
|
})]
|
|
153
153
|
})]
|
|
154
154
|
})
|
|
155
155
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ S("div", {
|
|
157
157
|
className: "flex items-center gap-2 justify-center flex-wrap",
|
|
158
158
|
children: [
|
|
159
159
|
"entities",
|
|
160
160
|
"options",
|
|
161
161
|
"review"
|
|
162
|
-
].map((e, t) => /* @__PURE__ */
|
|
162
|
+
].map((e, t) => /* @__PURE__ */ C("div", {
|
|
163
163
|
className: "flex items-center gap-2",
|
|
164
|
-
children: [t > 0 && /* @__PURE__ */
|
|
164
|
+
children: [t > 0 && /* @__PURE__ */ S(u, {
|
|
165
165
|
size: 18,
|
|
166
166
|
className: "text-muted-foreground"
|
|
167
|
-
}), /* @__PURE__ */
|
|
167
|
+
}), /* @__PURE__ */ C("div", {
|
|
168
168
|
className: i("flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200", M === e ? "bg-primary text-primary-foreground border-primary shadow-md scale-105" : "bg-muted/50 text-muted-foreground border-border/50"),
|
|
169
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ S("div", {
|
|
170
170
|
className: "flex items-center justify-center w-6 h-6 rounded-full bg-background/20 font-bold",
|
|
171
171
|
children: t + 1
|
|
172
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ S("span", {
|
|
173
173
|
className: "hidden sm:inline capitalize",
|
|
174
174
|
children: e === "entities" ? y("export.create.steps.entities", "Select Data") : e === "options" ? y("export.create.steps.options", "Options") : y("export.create.steps.review", "Review")
|
|
175
175
|
})]
|
|
176
176
|
})]
|
|
177
177
|
}, e))
|
|
178
178
|
}),
|
|
179
|
-
q && /* @__PURE__ */
|
|
179
|
+
q && /* @__PURE__ */ S("div", {
|
|
180
180
|
className: "border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-4 text-status-error-text text-sm",
|
|
181
181
|
children: q
|
|
182
182
|
}),
|
|
183
|
-
M === "entities" && /* @__PURE__ */
|
|
183
|
+
M === "entities" && /* @__PURE__ */ C("div", {
|
|
184
184
|
className: "space-y-4",
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ S("h2", {
|
|
187
187
|
className: "text-lg font-bold",
|
|
188
188
|
children: y("export.create.select.title", "Select data to export")
|
|
189
189
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ S("p", {
|
|
191
191
|
className: "text-sm text-muted-foreground",
|
|
192
192
|
children: y("export.create.select.description", "Choose which entity types to include in your export.")
|
|
193
193
|
}),
|
|
194
|
-
$.length === 0 ? /* @__PURE__ */
|
|
194
|
+
$.length === 0 ? /* @__PURE__ */ S("div", {
|
|
195
195
|
className: "border-2 border-border rounded-xl bg-muted/30 p-6 text-sm text-muted-foreground",
|
|
196
196
|
children: y("export.create.select.empty", "No exportable entity types are configured for this workspace yet.")
|
|
197
|
-
}) : /* @__PURE__ */
|
|
197
|
+
}) : /* @__PURE__ */ S("div", {
|
|
198
198
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
|
|
199
199
|
children: $.map((e) => {
|
|
200
200
|
let t = P.includes(e.entityType);
|
|
201
|
-
return /* @__PURE__ */
|
|
201
|
+
return /* @__PURE__ */ C("button", {
|
|
202
202
|
onClick: () => ue(e.entityType),
|
|
203
203
|
className: i("text-left border-2 rounded-xl p-4 transition-all duration-200", t ? "border-primary bg-primary/5 shadow-md" : "border-border/50 hover:border-primary/30 hover:shadow-sm"),
|
|
204
204
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ C("div", {
|
|
206
206
|
className: "flex items-center justify-between mb-2",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ S("h3", {
|
|
208
208
|
className: "font-semibold",
|
|
209
209
|
children: Q[e.entityType]?.label ?? e.displayName
|
|
210
|
-
}), t && /* @__PURE__ */
|
|
210
|
+
}), t && /* @__PURE__ */ S(f, {
|
|
211
211
|
size: 18,
|
|
212
212
|
className: "text-primary"
|
|
213
213
|
})]
|
|
214
214
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ S("p", {
|
|
216
216
|
className: "text-sm text-muted-foreground",
|
|
217
217
|
children: Q[e.entityType]?.description ?? e.description
|
|
218
218
|
}),
|
|
219
|
-
e.estimatedSize && /* @__PURE__ */
|
|
219
|
+
e.estimatedSize && /* @__PURE__ */ C("p", {
|
|
220
220
|
className: "text-xs text-muted-foreground mt-2",
|
|
221
221
|
children: ["~", e.estimatedSize]
|
|
222
222
|
})
|
|
@@ -226,51 +226,51 @@ function E() {
|
|
|
226
226
|
})
|
|
227
227
|
]
|
|
228
228
|
}),
|
|
229
|
-
M === "options" && /* @__PURE__ */
|
|
229
|
+
M === "options" && /* @__PURE__ */ S("div", {
|
|
230
230
|
className: "space-y-6",
|
|
231
|
-
children: /* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ C("div", {
|
|
232
232
|
className: "border-2 border-border/50 rounded-xl p-6 space-y-5",
|
|
233
233
|
children: [
|
|
234
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ S("h2", {
|
|
235
235
|
className: "text-lg font-bold",
|
|
236
236
|
children: y("export.create.options.title", "Export Options")
|
|
237
237
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
239
239
|
className: "block text-sm font-semibold mb-2",
|
|
240
240
|
children: y("export.create.options.scope", "Export Scope")
|
|
241
|
-
}), /* @__PURE__ */
|
|
241
|
+
}), /* @__PURE__ */ S("div", {
|
|
242
242
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
|
|
243
243
|
children: ae.map(({ value: e, Icon: t }) => {
|
|
244
244
|
let n = e === "WORKSPACE_ADMIN" && !j || e === "ORG_ADMIN" && !oe;
|
|
245
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ C("button", {
|
|
246
246
|
type: "button",
|
|
247
247
|
onClick: () => !n && V(e),
|
|
248
248
|
disabled: n,
|
|
249
249
|
className: i("text-left border-2 rounded-xl p-4 transition-all duration-200", B === e ? "border-primary bg-primary/5 shadow-md" : n ? "border-border/30 opacity-50 cursor-not-allowed" : "border-border/50 hover:border-primary/30 hover:shadow-sm"),
|
|
250
250
|
title: n ? e === "WORKSPACE_ADMIN" ? "Workspace admin access required" : "Organization admin access required" : void 0,
|
|
251
251
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ C("div", {
|
|
253
253
|
className: "flex items-center justify-between mb-2",
|
|
254
254
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ S(t, {
|
|
256
256
|
size: 18,
|
|
257
257
|
className: B === e ? "text-primary" : n ? "text-muted-foreground/50" : "text-muted-foreground"
|
|
258
258
|
}),
|
|
259
|
-
B === e && /* @__PURE__ */
|
|
259
|
+
B === e && /* @__PURE__ */ S(f, {
|
|
260
260
|
size: 16,
|
|
261
261
|
className: "text-primary"
|
|
262
262
|
}),
|
|
263
|
-
n && /* @__PURE__ */
|
|
263
|
+
n && /* @__PURE__ */ S(_, {
|
|
264
264
|
size: 14,
|
|
265
265
|
className: "text-muted-foreground/50"
|
|
266
266
|
})
|
|
267
267
|
]
|
|
268
268
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ S("p", {
|
|
270
270
|
className: "font-semibold text-sm",
|
|
271
271
|
children: Z(e)
|
|
272
272
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ S("p", {
|
|
274
274
|
className: "text-xs text-muted-foreground mt-1",
|
|
275
275
|
children: de(e)
|
|
276
276
|
})
|
|
@@ -278,18 +278,18 @@ function E() {
|
|
|
278
278
|
}, e);
|
|
279
279
|
})
|
|
280
280
|
})] }),
|
|
281
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
|
|
282
282
|
htmlFor: "exportName",
|
|
283
283
|
className: "block text-sm font-semibold mb-2",
|
|
284
284
|
children: [
|
|
285
285
|
y("export.create.options.name", "Export Name"),
|
|
286
286
|
" ",
|
|
287
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ S("span", {
|
|
288
288
|
className: "text-status-error-text",
|
|
289
289
|
children: "*"
|
|
290
290
|
})
|
|
291
291
|
]
|
|
292
|
-
}), /* @__PURE__ */
|
|
292
|
+
}), /* @__PURE__ */ S("input", {
|
|
293
293
|
type: "text",
|
|
294
294
|
id: "exportName",
|
|
295
295
|
value: I,
|
|
@@ -297,82 +297,82 @@ function E() {
|
|
|
297
297
|
className: "w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",
|
|
298
298
|
placeholder: y("export.create.options.namePlaceholder", "e.g., Monthly User Export")
|
|
299
299
|
})] }),
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
301
301
|
className: "block text-sm font-semibold mb-2",
|
|
302
302
|
children: y("export.create.options.outputFormat", "Output Format")
|
|
303
|
-
}), /* @__PURE__ */
|
|
303
|
+
}), /* @__PURE__ */ S("div", {
|
|
304
304
|
className: "grid grid-cols-2 gap-3",
|
|
305
305
|
children: T.map((e) => {
|
|
306
306
|
let t = ie[e];
|
|
307
|
-
return /* @__PURE__ */
|
|
307
|
+
return /* @__PURE__ */ C("button", {
|
|
308
308
|
onClick: () => z(e),
|
|
309
309
|
className: i("flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200", R === e ? "border-primary bg-primary/5" : "border-border/50 hover:border-primary/30"),
|
|
310
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ S(t, {
|
|
311
311
|
size: 18,
|
|
312
312
|
className: R === e ? "text-primary" : "text-muted-foreground"
|
|
313
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ S("span", {
|
|
314
314
|
className: "font-medium text-sm",
|
|
315
315
|
children: a(e)
|
|
316
316
|
})]
|
|
317
317
|
}, e);
|
|
318
318
|
})
|
|
319
319
|
})] }),
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ C("div", { children: [
|
|
321
|
+
/* @__PURE__ */ S("label", {
|
|
322
322
|
className: "block text-sm font-semibold mb-2",
|
|
323
323
|
children: y("export.create.options.archiveFormat", "Archive Format")
|
|
324
324
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ S("div", {
|
|
326
326
|
className: "flex gap-3",
|
|
327
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ C("div", {
|
|
328
328
|
className: i("flex items-center gap-2 border-2 rounded-lg px-4 py-2 border-primary bg-primary/5"),
|
|
329
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ S(re, {
|
|
330
330
|
size: 16,
|
|
331
331
|
className: "text-primary"
|
|
332
|
-
}), /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ S("span", {
|
|
333
333
|
className: "font-medium text-sm",
|
|
334
334
|
children: "ZIP"
|
|
335
335
|
})]
|
|
336
336
|
})
|
|
337
337
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ S("p", {
|
|
339
339
|
className: "text-xs text-muted-foreground mt-1.5",
|
|
340
340
|
children: y("export.create.options.archiveDescription", "Exports are packaged as ZIP archives.")
|
|
341
341
|
})
|
|
342
342
|
] }),
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ C("div", { children: [
|
|
344
|
+
/* @__PURE__ */ S("label", {
|
|
345
345
|
className: "block text-sm font-semibold mb-2",
|
|
346
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ C("span", {
|
|
347
347
|
className: "inline-flex items-center gap-1.5",
|
|
348
348
|
children: [
|
|
349
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ S(ne, { size: 15 }),
|
|
350
350
|
y("export.create.options.dateRange", "Date Range"),
|
|
351
351
|
" ",
|
|
352
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ S("span", {
|
|
353
353
|
className: "font-normal text-muted-foreground",
|
|
354
354
|
children: y("export.create.shared.optional", "(optional)")
|
|
355
355
|
})
|
|
356
356
|
]
|
|
357
357
|
})
|
|
358
358
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ C("div", {
|
|
360
360
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
362
362
|
htmlFor: "dateFrom",
|
|
363
363
|
className: "block text-xs text-muted-foreground mb-1",
|
|
364
364
|
children: y("export.create.options.dateFrom", "From")
|
|
365
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ S("input", {
|
|
366
366
|
type: "date",
|
|
367
367
|
id: "dateFrom",
|
|
368
368
|
value: W,
|
|
369
369
|
onChange: (e) => G(e.target.value),
|
|
370
370
|
className: "w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
|
|
371
|
-
})] }), /* @__PURE__ */
|
|
371
|
+
})] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
372
372
|
htmlFor: "dateTo",
|
|
373
373
|
className: "block text-xs text-muted-foreground mb-1",
|
|
374
374
|
children: y("export.create.options.dateTo", "To")
|
|
375
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ S("input", {
|
|
376
376
|
type: "date",
|
|
377
377
|
id: "dateTo",
|
|
378
378
|
value: K,
|
|
@@ -381,38 +381,38 @@ function E() {
|
|
|
381
381
|
className: "w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
|
|
382
382
|
})] })]
|
|
383
383
|
}),
|
|
384
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ S("p", {
|
|
385
385
|
className: "text-xs text-muted-foreground mt-1.5",
|
|
386
386
|
children: y("export.create.options.dateRangeDescription", "Leave blank to export all data regardless of date.")
|
|
387
387
|
})
|
|
388
388
|
] }),
|
|
389
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
|
|
390
390
|
className: "block text-sm font-semibold mb-2",
|
|
391
391
|
children: [
|
|
392
392
|
y("export.create.options.basedOnTemplate", "Based on Template"),
|
|
393
393
|
" ",
|
|
394
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ S("span", {
|
|
395
395
|
className: "font-normal text-muted-foreground",
|
|
396
396
|
children: y("export.create.shared.optional", "(optional)")
|
|
397
397
|
})
|
|
398
398
|
]
|
|
399
|
-
}), k.length > 0 ? /* @__PURE__ */
|
|
399
|
+
}), k.length > 0 ? /* @__PURE__ */ C("select", {
|
|
400
400
|
value: H ?? "",
|
|
401
401
|
onChange: (e) => U(e.target.value || void 0),
|
|
402
402
|
className: "w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ S("option", {
|
|
404
404
|
value: "",
|
|
405
405
|
children: y("export.create.options.noTemplate", "No template")
|
|
406
|
-
}), k.map((e) => /* @__PURE__ */
|
|
406
|
+
}), k.map((e) => /* @__PURE__ */ S("option", {
|
|
407
407
|
value: e.id,
|
|
408
408
|
children: e.name
|
|
409
409
|
}, e.id))]
|
|
410
|
-
}) : /* @__PURE__ */
|
|
410
|
+
}) : /* @__PURE__ */ C("p", {
|
|
411
411
|
className: "text-sm text-muted-foreground",
|
|
412
412
|
children: [
|
|
413
413
|
y("export.create.options.noTemplates", "No templates yet."),
|
|
414
414
|
" ",
|
|
415
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ S("button", {
|
|
416
416
|
type: "button",
|
|
417
417
|
onClick: () => m?.(d + "/templates"),
|
|
418
418
|
className: "text-primary underline-offset-2 hover:underline",
|
|
@@ -425,17 +425,17 @@ function E() {
|
|
|
425
425
|
]
|
|
426
426
|
})
|
|
427
427
|
}),
|
|
428
|
-
M === "review" && /* @__PURE__ */
|
|
428
|
+
M === "review" && /* @__PURE__ */ S("div", {
|
|
429
429
|
className: "space-y-6",
|
|
430
|
-
children: /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ C("div", {
|
|
431
431
|
className: "border-2 border-primary/50 rounded-xl bg-primary/5 p-6 space-y-4",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
433
433
|
className: "text-lg font-bold flex items-center gap-2",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ S(f, {
|
|
435
435
|
size: 20,
|
|
436
436
|
className: "text-primary"
|
|
437
437
|
}), y("export.create.review.title", "Review Export")]
|
|
438
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ S("dl", {
|
|
439
439
|
className: "space-y-3 text-sm",
|
|
440
440
|
children: [
|
|
441
441
|
{
|
|
@@ -466,12 +466,12 @@ function E() {
|
|
|
466
466
|
label: y("export.create.review.fields.template", "Template"),
|
|
467
467
|
value: k.find((e) => e.id === H)?.name ?? H
|
|
468
468
|
}] : []
|
|
469
|
-
].map(({ label: e, value: t }) => /* @__PURE__ */
|
|
469
|
+
].map(({ label: e, value: t }) => /* @__PURE__ */ C("div", {
|
|
470
470
|
className: "flex flex-col sm:flex-row sm:justify-between gap-1",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ S("dt", {
|
|
472
472
|
className: "text-muted-foreground",
|
|
473
473
|
children: e
|
|
474
|
-
}), /* @__PURE__ */
|
|
474
|
+
}), /* @__PURE__ */ S("dd", {
|
|
475
475
|
className: "font-semibold sm:text-right break-words",
|
|
476
476
|
children: t
|
|
477
477
|
})]
|
|
@@ -479,24 +479,24 @@ function E() {
|
|
|
479
479
|
})]
|
|
480
480
|
})
|
|
481
481
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ C("div", {
|
|
483
483
|
className: "flex flex-col sm:flex-row gap-3 pt-2",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ S("button", {
|
|
485
485
|
onClick: ce,
|
|
486
486
|
className: "px-6 py-3 border-2 border-border/50 rounded-lg hover:bg-accent hover:border-primary/30 transition-all duration-200 font-medium",
|
|
487
487
|
children: M === "entities" ? y("export.create.actions.cancel", "Cancel") : y("export.create.actions.back", "Back")
|
|
488
|
-
}), M === "review" ? /* @__PURE__ */
|
|
488
|
+
}), M === "review" ? /* @__PURE__ */ C("button", {
|
|
489
489
|
onClick: le,
|
|
490
490
|
disabled: D,
|
|
491
491
|
className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all duration-200 hover:scale-105 font-bold shadow-lg disabled:opacity-50 disabled:cursor-not-allowed",
|
|
492
|
-
children: [D ? /* @__PURE__ */
|
|
492
|
+
children: [D ? /* @__PURE__ */ S(g, {
|
|
493
493
|
size: 18,
|
|
494
494
|
className: "animate-spin"
|
|
495
|
-
}) : /* @__PURE__ */
|
|
496
|
-
}) : /* @__PURE__ */
|
|
495
|
+
}) : /* @__PURE__ */ S(p, { size: 18 }), y("export.create.actions.startExport", "Start Export")]
|
|
496
|
+
}) : /* @__PURE__ */ C("button", {
|
|
497
497
|
onClick: X,
|
|
498
498
|
className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all duration-200 hover:scale-105 font-bold shadow-lg",
|
|
499
|
-
children: [y("export.create.actions.next", "Next"), /* @__PURE__ */
|
|
499
|
+
children: [y("export.create.actions.next", "Next"), /* @__PURE__ */ S(u, { size: 18 })]
|
|
500
500
|
})]
|
|
501
501
|
})
|
|
502
502
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateExportPage.js","names":[],"sources":["../../../src/export/pages/CreateExportPage.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport {\n ArrowLeft,\n ArrowRight,\n Download,\n CheckCircle2,\n Loader2,\n FileSpreadsheet,\n FileJson,\n Package,\n CalendarRange,\n User,\n Users,\n Building2,\n Lock,\n} from \"lucide-react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { usePermission } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport {\n useCreateExportJob,\n useAvailableEntities,\n useExportTemplates,\n} from \"../hooks/useExportQueries\";\nimport { getFormatDisplayName } from \"../constants/enums\";\nimport { PageLayout } from \"../components/PageLayout\";\nimport { cn } from \"../utils/cn\";\nimport type { ExportFormat, ExportScope } from \"../types\";\nimport { tWithFallback } from \"../utils/i18n\";\n\ntype WizardStep = \"entities\" | \"options\" | \"review\";\n\n// Backend only supports CSV and JSON\nconst SUPPORTED_FORMATS: ExportFormat[] = [\"CSV\", \"JSON\"];\n\nconst FORMAT_ICONS: Record<ExportFormat, typeof FileJson> = {\n CSV: FileSpreadsheet,\n JSON: FileJson,\n};\n\n/**\n * Create Export Page\n * Multi-step form: select entities, configure options, review & start\n */\nconst SCOPE_OPTIONS: Array<{\n value: ExportScope;\n label: string;\n description: string;\n Icon: typeof User;\n}> = [\n {\n value: \"INDIVIDUAL\",\n label: \"My Data Only\",\n description: \"Export data you personally created across selected modules.\",\n Icon: User,\n },\n {\n value: \"WORKSPACE_ADMIN\",\n label: \"All Workspace Data\",\n description:\n \"Export all data in this workspace regardless of who created it. Requires workspace admin access.\",\n Icon: Users,\n },\n {\n value: \"ORG_ADMIN\",\n label: \"All Organization Data\",\n description:\n \"Export data from every workspace in your organization. Requires org-admin access.\",\n Icon: Building2,\n },\n];\n\nexport function CreateExportPage() {\n const { basePath = \"/\", navigate, organizationId } = useExport();\n const { t } = useI18n();\n const tr = (\n key: string,\n fallback: string,\n params?: Record<string, string | number>,\n ) => tWithFallback(t, key, fallback, params);\n const { createJob, isPending } = useCreateExportJob();\n const { data: availableEntities } = useAvailableEntities();\n const { data: templates } = useExportTemplates();\n const [searchParams] = useSearchParams();\n\n // RBAC: Check permissions for admin scopes\n const canExportWorkspaceAdmin = usePermission(\"export:workspace:admin\");\n const canExportOrgAdmin = usePermission(\"export:org:admin\");\n\n const [step, setStep] = useState<WizardStep>(\"entities\");\n const [selectedEntities, setSelectedEntities] = useState<string[]>([]);\n const [exportName, setExportName] = useState(\"\");\n const [selectedFormat, setSelectedFormat] = useState<ExportFormat>(\"CSV\");\n const [selectedScope, setSelectedScope] = useState<ExportScope>(\"INDIVIDUAL\");\n const [selectedTemplateId, setSelectedTemplateId] = useState<\n string | undefined\n >(searchParams.get(\"templateId\") ?? undefined);\n const [dateRangeStart, setDateRangeStart] = useState(\"\");\n const [dateRangeEnd, setDateRangeEnd] = useState(\"\");\n const [error, setError] = useState<string | null>(null);\n\n // Pre-populate form when arriving from \"Use Template\" — apply only once per templateId\n const appliedTemplateRef = useRef<string | null>(null);\n useEffect(() => {\n const paramTemplateId = searchParams.get(\"templateId\");\n if (!paramTemplateId || !templates?.length) return;\n if (appliedTemplateRef.current === paramTemplateId) return;\n const tpl = templates.find((t) => t.id === paramTemplateId);\n if (!tpl) return;\n appliedTemplateRef.current = paramTemplateId;\n setSelectedTemplateId(tpl.id);\n setSelectedEntities(tpl.entityTypes ?? []);\n const normalizedFormat = tpl.format?.toUpperCase() as\n | ExportFormat\n | undefined;\n if (normalizedFormat && SUPPORTED_FORMATS.includes(normalizedFormat)) {\n setSelectedFormat(normalizedFormat);\n }\n if (tpl.name) setExportName(tpl.name);\n }, [searchParams, templates]);\n\n const handleBack = () => {\n if (step === \"options\") setStep(\"entities\");\n else if (step === \"review\") setStep(\"options\");\n else navigate?.(basePath);\n };\n\n const handleNext = () => {\n if (step === \"entities\") {\n if (selectedEntities.length === 0) {\n setError(\n tr(\n \"export.create.errors.selectEntity\",\n \"Please select at least one entity type to export\",\n ),\n );\n return;\n }\n setError(null);\n setStep(\"options\");\n } else if (step === \"options\") {\n if (!exportName.trim()) {\n setError(\n tr(\n \"export.create.errors.exportNameRequired\",\n \"Please provide a name for this export\",\n ),\n );\n return;\n }\n setError(null);\n setStep(\"review\");\n }\n };\n\n const handleSubmit = async () => {\n try {\n setError(null);\n await createJob({\n name: exportName,\n entityTypes: selectedEntities,\n format: selectedFormat,\n exportScope: selectedScope,\n organizationId:\n selectedScope === \"ORG_ADMIN\" ? organizationId : undefined,\n templateId: selectedTemplateId,\n dateRangeStart: dateRangeStart\n ? new Date(dateRangeStart).toISOString()\n : null,\n dateRangeEnd: dateRangeEnd\n ? new Date(dateRangeEnd).toISOString()\n : null,\n });\n navigate?.(basePath);\n } catch (err) {\n setError(\n err instanceof Error\n ? err.message\n : tr(\"export.create.errors.createFailed\", \"Failed to create export\"),\n );\n }\n };\n\n const toggleEntity = (entityType: string) => {\n setSelectedEntities((prev) =>\n prev.includes(entityType)\n ? prev.filter((e) => e !== entityType)\n : [...prev, entityType],\n );\n };\n\n const getScopeLabel = (scope: ExportScope) => {\n switch (scope) {\n case \"INDIVIDUAL\":\n return tr(\"export.create.scope.individual.label\", \"My Data Only\");\n case \"WORKSPACE_ADMIN\":\n return tr(\n \"export.create.scope.workspaceAdmin.label\",\n \"All Workspace Data\",\n );\n case \"ORG_ADMIN\":\n return tr(\n \"export.create.scope.orgAdmin.label\",\n \"All Organization Data\",\n );\n default:\n return scope;\n }\n };\n\n const getScopeDescription = (scope: ExportScope) => {\n switch (scope) {\n case \"INDIVIDUAL\":\n return tr(\n \"export.create.scope.individual.description\",\n \"Export data you personally created across selected modules.\",\n );\n case \"WORKSPACE_ADMIN\":\n return tr(\n \"export.create.scope.workspaceAdmin.description\",\n \"Export all data in this workspace regardless of who created it. Requires workspace admin access.\",\n );\n case \"ORG_ADMIN\":\n return tr(\n \"export.create.scope.orgAdmin.description\",\n \"Export data from every workspace in your organization. Requires org-admin access.\",\n );\n default:\n return \"\";\n }\n };\n\n const fallbackEntityCopy: Record<\n string,\n { label: string; description: string }\n > = {\n users: {\n label: tr(\"export.create.entities.users.label\", \"Users\"),\n description: tr(\n \"export.create.entities.users.description\",\n \"Workspace members and profiles\",\n ),\n },\n projects: {\n label: tr(\"export.create.entities.projects.label\", \"Projects\"),\n description: tr(\n \"export.create.entities.projects.description\",\n \"Projects and their metadata\",\n ),\n },\n tasks: {\n label: tr(\"export.create.entities.tasks.label\", \"Tasks\"),\n description: tr(\n \"export.create.entities.tasks.description\",\n \"Task items and assignments\",\n ),\n },\n files: {\n label: tr(\"export.create.entities.files.label\", \"Files\"),\n description: tr(\n \"export.create.entities.files.description\",\n \"File metadata and references\",\n ),\n },\n conversations: {\n label: tr(\"export.create.entities.conversations.label\", \"Conversations\"),\n description: tr(\n \"export.create.entities.conversations.description\",\n \"Chat messages and threads\",\n ),\n },\n tags: {\n label: tr(\"export.create.entities.tags.label\", \"Tags\"),\n description: tr(\n \"export.create.entities.tags.description\",\n \"Tags and vocabularies\",\n ),\n },\n activity: {\n label: tr(\"export.create.entities.activity.label\", \"Activity Logs\"),\n description: tr(\n \"export.create.entities.activity.description\",\n \"Audit trail and activity history\",\n ),\n },\n calendar: {\n label: tr(\"export.create.entities.calendar.label\", \"Calendar Events\"),\n description: tr(\n \"export.create.entities.calendar.description\",\n \"Events and bookings\",\n ),\n },\n };\n\n // Only show enabled entities\n const enabledEntities = availableEntities.filter((e) => e.enabled !== false);\n\n return (\n <PageLayout showHeader={false}>\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n onClick={() => navigate?.(basePath)}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all duration-200 hover:scale-110\"\n aria-label={tr(\n \"export.create.actions.backToDashboard\",\n \"Back to export dashboard\",\n )}\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-primary/10 backdrop-blur-sm\">\n <Download size={24} className=\"text-primary\" />\n </div>\n <h1 className=\"text-2xl sm:text-3xl font-bold\">\n {tr(\"export.create.title\", \"New Export\")}\n </h1>\n </div>\n </div>\n </div>\n\n {/* Step Indicator */}\n <div className=\"flex items-center gap-2 justify-center flex-wrap\">\n {([\"entities\", \"options\", \"review\"] as WizardStep[]).map((s, i) => (\n <div key={s} className=\"flex items-center gap-2\">\n {i > 0 && (\n <ArrowRight size={18} className=\"text-muted-foreground\" />\n )}\n <div\n className={cn(\n \"flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200\",\n step === s\n ? \"bg-primary text-primary-foreground border-primary shadow-md scale-105\"\n : \"bg-muted/50 text-muted-foreground border-border/50\",\n )}\n >\n <div className=\"flex items-center justify-center w-6 h-6 rounded-full bg-background/20 font-bold\">\n {i + 1}\n </div>\n <span className=\"hidden sm:inline capitalize\">\n {s === \"entities\"\n ? tr(\"export.create.steps.entities\", \"Select Data\")\n : s === \"options\"\n ? tr(\"export.create.steps.options\", \"Options\")\n : tr(\"export.create.steps.review\", \"Review\")}\n </span>\n </div>\n </div>\n ))}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-4 text-status-error-text text-sm\">\n {error}\n </div>\n )}\n\n {/* Step 1: Select Entities */}\n {step === \"entities\" && (\n <div className=\"space-y-4\">\n <h2 className=\"text-lg font-bold\">\n {tr(\"export.create.select.title\", \"Select data to export\")}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {tr(\n \"export.create.select.description\",\n \"Choose which entity types to include in your export.\",\n )}\n </p>\n {enabledEntities.length === 0 ? (\n <div className=\"border-2 border-border rounded-xl bg-muted/30 p-6 text-sm text-muted-foreground\">\n {tr(\n \"export.create.select.empty\",\n \"No exportable entity types are configured for this workspace yet.\",\n )}\n </div>\n ) : (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {enabledEntities.map((entity) => {\n const isSelected = selectedEntities.includes(entity.entityType);\n return (\n <button\n key={entity.entityType}\n onClick={() => toggleEntity(entity.entityType)}\n className={cn(\n \"text-left border-2 rounded-xl p-4 transition-all duration-200\",\n isSelected\n ? \"border-primary bg-primary/5 shadow-md\"\n : \"border-border/50 hover:border-primary/30 hover:shadow-sm\",\n )}\n >\n <div className=\"flex items-center justify-between mb-2\">\n <h3 className=\"font-semibold\">\n {fallbackEntityCopy[entity.entityType]?.label ??\n entity.displayName}\n </h3>\n {isSelected && (\n <CheckCircle2 size={18} className=\"text-primary\" />\n )}\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {fallbackEntityCopy[entity.entityType]?.description ??\n entity.description}\n </p>\n {entity.estimatedSize && (\n <p className=\"text-xs text-muted-foreground mt-2\">\n ~{entity.estimatedSize}\n </p>\n )}\n </button>\n );\n })}\n </div>\n )}\n </div>\n )}\n\n {/* Step 2: Configure Options */}\n {step === \"options\" && (\n <div className=\"space-y-6\">\n <div className=\"border-2 border-border/50 rounded-xl p-6 space-y-5\">\n <h2 className=\"text-lg font-bold\">\n {tr(\"export.create.options.title\", \"Export Options\")}\n </h2>\n\n {/* Scope selection */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n {tr(\"export.create.options.scope\", \"Export Scope\")}\n </label>\n <div className=\"grid grid-cols-1 sm:grid-cols-3 gap-3\">\n {SCOPE_OPTIONS.map(({ value, Icon }) => {\n // RBAC: Disable admin scopes if user lacks permission\n const isDisabled =\n (value === \"WORKSPACE_ADMIN\" && !canExportWorkspaceAdmin) ||\n (value === \"ORG_ADMIN\" && !canExportOrgAdmin);\n\n return (\n <button\n key={value}\n type=\"button\"\n onClick={() => !isDisabled && setSelectedScope(value)}\n disabled={isDisabled}\n className={cn(\n \"text-left border-2 rounded-xl p-4 transition-all duration-200\",\n selectedScope === value\n ? \"border-primary bg-primary/5 shadow-md\"\n : isDisabled\n ? \"border-border/30 opacity-50 cursor-not-allowed\"\n : \"border-border/50 hover:border-primary/30 hover:shadow-sm\",\n )}\n title={\n isDisabled\n ? value === \"WORKSPACE_ADMIN\"\n ? \"Workspace admin access required\"\n : \"Organization admin access required\"\n : undefined\n }\n >\n <div className=\"flex items-center justify-between mb-2\">\n <Icon\n size={18}\n className={\n selectedScope === value\n ? \"text-primary\"\n : isDisabled\n ? \"text-muted-foreground/50\"\n : \"text-muted-foreground\"\n }\n />\n {selectedScope === value && (\n <CheckCircle2 size={16} className=\"text-primary\" />\n )}\n {isDisabled && (\n <Lock\n size={14}\n className=\"text-muted-foreground/50\"\n />\n )}\n </div>\n <p className=\"font-semibold text-sm\">\n {getScopeLabel(value)}\n </p>\n <p className=\"text-xs text-muted-foreground mt-1\">\n {getScopeDescription(value)}\n </p>\n </button>\n );\n })}\n </div>\n </div>\n\n {/* Name */}\n <div>\n <label\n htmlFor=\"exportName\"\n className=\"block text-sm font-semibold mb-2\"\n >\n {tr(\"export.create.options.name\", \"Export Name\")}{\" \"}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"exportName\"\n value={exportName}\n onChange={(e) => setExportName(e.target.value)}\n className=\"w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200\"\n placeholder={tr(\n \"export.create.options.namePlaceholder\",\n \"e.g., Monthly User Export\",\n )}\n />\n </div>\n\n {/* Format — only CSV and JSON are supported */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n {tr(\"export.create.options.outputFormat\", \"Output Format\")}\n </label>\n <div className=\"grid grid-cols-2 gap-3\">\n {SUPPORTED_FORMATS.map((format) => {\n const Icon = FORMAT_ICONS[format];\n return (\n <button\n key={format}\n onClick={() => setSelectedFormat(format)}\n className={cn(\n \"flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200\",\n selectedFormat === format\n ? \"border-primary bg-primary/5\"\n : \"border-border/50 hover:border-primary/30\",\n )}\n >\n <Icon\n size={18}\n className={\n selectedFormat === format\n ? \"text-primary\"\n : \"text-muted-foreground\"\n }\n />\n <span className=\"font-medium text-sm\">\n {getFormatDisplayName(format)}\n </span>\n </button>\n );\n })}\n </div>\n </div>\n\n {/* Archive format — only ZIP is supported */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n {tr(\"export.create.options.archiveFormat\", \"Archive Format\")}\n </label>\n <div className=\"flex gap-3\">\n <div\n className={cn(\n \"flex items-center gap-2 border-2 rounded-lg px-4 py-2 border-primary bg-primary/5\",\n )}\n >\n <Package size={16} className=\"text-primary\" />\n <span className=\"font-medium text-sm\">ZIP</span>\n </div>\n </div>\n <p className=\"text-xs text-muted-foreground mt-1.5\">\n {tr(\n \"export.create.options.archiveDescription\",\n \"Exports are packaged as ZIP archives.\",\n )}\n </p>\n </div>\n\n {/* Date range filter — always visible */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n <span className=\"inline-flex items-center gap-1.5\">\n <CalendarRange size={15} />\n {tr(\"export.create.options.dateRange\", \"Date Range\")}{\" \"}\n <span className=\"font-normal text-muted-foreground\">\n {tr(\"export.create.shared.optional\", \"(optional)\")}\n </span>\n </span>\n </label>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n <div>\n <label\n htmlFor=\"dateFrom\"\n className=\"block text-xs text-muted-foreground mb-1\"\n >\n {tr(\"export.create.options.dateFrom\", \"From\")}\n </label>\n <input\n type=\"date\"\n id=\"dateFrom\"\n value={dateRangeStart}\n onChange={(e) => setDateRangeStart(e.target.value)}\n className=\"w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm\"\n />\n </div>\n <div>\n <label\n htmlFor=\"dateTo\"\n className=\"block text-xs text-muted-foreground mb-1\"\n >\n {tr(\"export.create.options.dateTo\", \"To\")}\n </label>\n <input\n type=\"date\"\n id=\"dateTo\"\n value={dateRangeEnd}\n min={dateRangeStart}\n onChange={(e) => setDateRangeEnd(e.target.value)}\n className=\"w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm\"\n />\n </div>\n </div>\n <p className=\"text-xs text-muted-foreground mt-1.5\">\n {tr(\n \"export.create.options.dateRangeDescription\",\n \"Leave blank to export all data regardless of date.\",\n )}\n </p>\n </div>\n\n {/* Optional: Use a template */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n {tr(\n \"export.create.options.basedOnTemplate\",\n \"Based on Template\",\n )}{\" \"}\n <span className=\"font-normal text-muted-foreground\">\n {tr(\"export.create.shared.optional\", \"(optional)\")}\n </span>\n </label>\n {templates.length > 0 ? (\n <select\n value={selectedTemplateId ?? \"\"}\n onChange={(e) =>\n setSelectedTemplateId(e.target.value || undefined)\n }\n className=\"w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"\">\n {tr(\"export.create.options.noTemplate\", \"No template\")}\n </option>\n {templates.map((t) => (\n <option key={t.id} value={t.id}>\n {t.name}\n </option>\n ))}\n </select>\n ) : (\n <p className=\"text-sm text-muted-foreground\">\n {tr(\"export.create.options.noTemplates\", \"No templates yet.\")}{\" \"}\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath + \"/templates\")}\n className=\"text-primary underline-offset-2 hover:underline\"\n >\n {tr(\n \"export.create.options.createTemplateLink\",\n \"Create one\",\n )}\n </button>{\" \"}\n {tr(\n \"export.create.options.reuseTemplateHint\",\n \"to reuse export configurations.\",\n )}\n </p>\n )}\n </div>\n </div>\n </div>\n )}\n\n {/* Step 3: Review */}\n {step === \"review\" && (\n <div className=\"space-y-6\">\n <div className=\"border-2 border-primary/50 rounded-xl bg-primary/5 p-6 space-y-4\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <CheckCircle2 size={20} className=\"text-primary\" />\n {tr(\"export.create.review.title\", \"Review Export\")}\n </h2>\n <dl className=\"space-y-3 text-sm\">\n {[\n {\n label: tr(\"export.create.review.fields.name\", \"Name\"),\n value: exportName,\n },\n {\n label: tr(\"export.create.review.fields.scope\", \"Scope\"),\n value: getScopeLabel(selectedScope),\n },\n {\n label: tr(\n \"export.create.review.fields.entityTypes\",\n \"Entity Types\",\n ),\n value: selectedEntities.join(\", \"),\n },\n {\n label: tr(\"export.create.review.fields.format\", \"Format\"),\n value: getFormatDisplayName(selectedFormat),\n },\n {\n label: tr(\"export.create.review.fields.archive\", \"Archive\"),\n value: \"ZIP\",\n },\n ...(dateRangeStart || dateRangeEnd\n ? [\n {\n label: tr(\n \"export.create.review.fields.dateRange\",\n \"Date Range\",\n ),\n value: [\n dateRangeStart || \"—\",\n dateRangeEnd || \"—\",\n ].join(\" → \"),\n },\n ]\n : []),\n ...(selectedTemplateId\n ? [\n {\n label: tr(\n \"export.create.review.fields.template\",\n \"Template\",\n ),\n value:\n templates.find((t) => t.id === selectedTemplateId)\n ?.name ?? selectedTemplateId,\n },\n ]\n : []),\n ].map(({ label, value }) => (\n <div\n key={label}\n className=\"flex flex-col sm:flex-row sm:justify-between gap-1\"\n >\n <dt className=\"text-muted-foreground\">{label}</dt>\n <dd className=\"font-semibold sm:text-right break-words\">\n {value}\n </dd>\n </div>\n ))}\n </dl>\n </div>\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex flex-col sm:flex-row gap-3 pt-2\">\n <button\n onClick={handleBack}\n className=\"px-6 py-3 border-2 border-border/50 rounded-lg hover:bg-accent hover:border-primary/30 transition-all duration-200 font-medium\"\n >\n {step === \"entities\"\n ? tr(\"export.create.actions.cancel\", \"Cancel\")\n : tr(\"export.create.actions.back\", \"Back\")}\n </button>\n {step === \"review\" ? (\n <button\n onClick={handleSubmit}\n disabled={isPending}\n className=\"flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all duration-200 hover:scale-105 font-bold shadow-lg disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {isPending ? (\n <Loader2 size={18} className=\"animate-spin\" />\n ) : (\n <Download size={18} />\n )}\n {tr(\"export.create.actions.startExport\", \"Start Export\")}\n </button>\n ) : (\n <button\n onClick={handleNext}\n className=\"flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all duration-200 hover:scale-105 font-bold shadow-lg\"\n >\n {tr(\"export.create.actions.next\", \"Next\")}\n <ArrowRight size={18} />\n </button>\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,IAAM,IAAoC,CAAC,OAAO,OAAO,EAEnD,KAAsD;CAC1D,KAAK;CACL,MAAM;CACP,EAMK,KAKD;CACH;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,aACE;EACF,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,aACE;EACF,MAAM;EACP;CACF;AAED,SAAgB,IAAmB;CACjC,IAAM,EAAE,cAAW,KAAK,aAAU,sBAAmB,GAAW,EAC1D,EAAE,SAAM,GAAS,EACjB,KACJ,GACA,GACA,MACG,EAAc,GAAG,GAAK,GAAU,EAAO,EACtC,EAAE,cAAW,iBAAc,GAAoB,EAC/C,EAAE,MAAM,MAAsB,GAAsB,EACpD,EAAE,MAAM,MAAc,GAAoB,EAC1C,CAAC,KAAgB,GAAiB,EAGlC,IAA0B,EAAc,yBAAyB,EACjE,KAAoB,EAAc,mBAAmB,EAErD,CAAC,GAAM,KAAW,EAAqB,WAAW,EAClD,CAAC,GAAkB,KAAuB,EAAmB,EAAE,CAAC,EAChE,CAAC,GAAY,KAAiB,EAAS,GAAG,EAC1C,CAAC,GAAgB,KAAqB,EAAuB,MAAM,EACnE,CAAC,GAAe,KAAoB,EAAsB,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":"CreateExportPage.js","names":[],"sources":["../../../src/export/pages/CreateExportPage.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport {\n ArrowLeft,\n ArrowRight,\n Download,\n CheckCircle2,\n Loader2,\n FileSpreadsheet,\n FileJson,\n Package,\n CalendarRange,\n User,\n Users,\n Building2,\n Lock,\n} from \"lucide-react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { usePermission } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport {\n useCreateExportJob,\n useAvailableEntities,\n useExportTemplates,\n} from \"../hooks/useExportQueries\";\nimport { getFormatDisplayName } from \"../constants/enums\";\nimport { PageLayout } from \"../components/PageLayout\";\nimport { cn } from \"../utils/cn\";\nimport type { ExportFormat, ExportScope } from \"../types\";\nimport { tWithFallback } from \"../utils/i18n\";\n\ntype WizardStep = \"entities\" | \"options\" | \"review\";\n\n// Backend only supports CSV and JSON\nconst SUPPORTED_FORMATS: ExportFormat[] = [\"CSV\", \"JSON\"];\n\nconst FORMAT_ICONS: Record<ExportFormat, typeof FileJson> = {\n CSV: FileSpreadsheet,\n JSON: FileJson,\n};\n\n/**\n * Create Export Page\n * Multi-step form: select entities, configure options, review & start\n */\nconst SCOPE_OPTIONS: Array<{\n value: ExportScope;\n label: string;\n description: string;\n Icon: typeof User;\n}> = [\n {\n value: \"INDIVIDUAL\",\n label: \"My Data Only\",\n description: \"Export data you personally created across selected modules.\",\n Icon: User,\n },\n {\n value: \"WORKSPACE_ADMIN\",\n label: \"All Workspace Data\",\n description:\n \"Export all data in this workspace regardless of who created it. Requires workspace admin access.\",\n Icon: Users,\n },\n {\n value: \"ORG_ADMIN\",\n label: \"All Organization Data\",\n description:\n \"Export data from every workspace in your organization. Requires org-admin access.\",\n Icon: Building2,\n },\n];\n\nexport function CreateExportPage() {\n const { basePath = \"/\", navigate, organizationId } = useExport();\n const { t } = useI18n();\n const tr = (\n key: string,\n fallback: string,\n params?: Record<string, string | number>,\n ) => tWithFallback(t, key, fallback, params);\n const { createJob, isPending } = useCreateExportJob();\n const { data: availableEntities } = useAvailableEntities();\n const { data: templates } = useExportTemplates();\n const [searchParams] = useSearchParams();\n\n // RBAC: Check permissions for admin scopes\n const canExportWorkspaceAdmin = usePermission(\"export:workspace:admin\");\n const canExportOrgAdmin = usePermission(\"export:org:admin\");\n\n const [step, setStep] = useState<WizardStep>(\"entities\");\n const [selectedEntities, setSelectedEntities] = useState<string[]>([]);\n const [exportName, setExportName] = useState(\"\");\n const [selectedFormat, setSelectedFormat] = useState<ExportFormat>(\"CSV\");\n const [selectedScope, setSelectedScope] = useState<ExportScope>(\"INDIVIDUAL\");\n const [selectedTemplateId, setSelectedTemplateId] = useState<\n string | undefined\n >(searchParams.get(\"templateId\") ?? undefined);\n const [dateRangeStart, setDateRangeStart] = useState(\"\");\n const [dateRangeEnd, setDateRangeEnd] = useState(\"\");\n const [error, setError] = useState<string | null>(null);\n\n // Pre-populate form when arriving from \"Use Template\" — apply only once per templateId\n const appliedTemplateRef = useRef<string | null>(null);\n useEffect(() => {\n const paramTemplateId = searchParams.get(\"templateId\");\n if (!paramTemplateId || !templates?.length) return;\n if (appliedTemplateRef.current === paramTemplateId) return;\n const tpl = templates.find((t) => t.id === paramTemplateId);\n if (!tpl) return;\n appliedTemplateRef.current = paramTemplateId;\n setSelectedTemplateId(tpl.id);\n setSelectedEntities(tpl.entityTypes ?? []);\n const normalizedFormat = tpl.format?.toUpperCase() as\n | ExportFormat\n | undefined;\n if (normalizedFormat && SUPPORTED_FORMATS.includes(normalizedFormat)) {\n setSelectedFormat(normalizedFormat);\n }\n if (tpl.name) setExportName(tpl.name);\n }, [searchParams, templates]);\n\n const handleBack = () => {\n if (step === \"options\") setStep(\"entities\");\n else if (step === \"review\") setStep(\"options\");\n else navigate?.(basePath);\n };\n\n const handleNext = () => {\n if (step === \"entities\") {\n if (selectedEntities.length === 0) {\n setError(\n tr(\n \"export.create.errors.selectEntity\",\n \"Please select at least one entity type to export\",\n ),\n );\n return;\n }\n setError(null);\n setStep(\"options\");\n } else if (step === \"options\") {\n if (!exportName.trim()) {\n setError(\n tr(\n \"export.create.errors.exportNameRequired\",\n \"Please provide a name for this export\",\n ),\n );\n return;\n }\n setError(null);\n setStep(\"review\");\n }\n };\n\n const handleSubmit = async () => {\n try {\n setError(null);\n await createJob({\n name: exportName,\n entityTypes: selectedEntities,\n format: selectedFormat,\n exportScope: selectedScope,\n organizationId:\n selectedScope === \"ORG_ADMIN\" ? organizationId : undefined,\n templateId: selectedTemplateId,\n dateRangeStart: dateRangeStart\n ? new Date(dateRangeStart).toISOString()\n : null,\n dateRangeEnd: dateRangeEnd\n ? new Date(dateRangeEnd).toISOString()\n : null,\n });\n navigate?.(basePath);\n } catch (err) {\n setError(\n err instanceof Error\n ? err.message\n : tr(\"export.create.errors.createFailed\", \"Failed to create export\"),\n );\n }\n };\n\n const toggleEntity = (entityType: string) => {\n setSelectedEntities((prev) =>\n prev.includes(entityType)\n ? prev.filter((e) => e !== entityType)\n : [...prev, entityType],\n );\n };\n\n const getScopeLabel = (scope: ExportScope) => {\n switch (scope) {\n case \"INDIVIDUAL\":\n return tr(\"export.create.scope.individual.label\", \"My Data Only\");\n case \"WORKSPACE_ADMIN\":\n return tr(\n \"export.create.scope.workspaceAdmin.label\",\n \"All Workspace Data\",\n );\n case \"ORG_ADMIN\":\n return tr(\n \"export.create.scope.orgAdmin.label\",\n \"All Organization Data\",\n );\n default:\n return scope;\n }\n };\n\n const getScopeDescription = (scope: ExportScope) => {\n switch (scope) {\n case \"INDIVIDUAL\":\n return tr(\n \"export.create.scope.individual.description\",\n \"Export data you personally created across selected modules.\",\n );\n case \"WORKSPACE_ADMIN\":\n return tr(\n \"export.create.scope.workspaceAdmin.description\",\n \"Export all data in this workspace regardless of who created it. Requires workspace admin access.\",\n );\n case \"ORG_ADMIN\":\n return tr(\n \"export.create.scope.orgAdmin.description\",\n \"Export data from every workspace in your organization. Requires org-admin access.\",\n );\n default:\n return \"\";\n }\n };\n\n const fallbackEntityCopy: Record<\n string,\n { label: string; description: string }\n > = {\n users: {\n label: tr(\"export.create.entities.users.label\", \"Users\"),\n description: tr(\n \"export.create.entities.users.description\",\n \"Workspace members and profiles\",\n ),\n },\n projects: {\n label: tr(\"export.create.entities.projects.label\", \"Projects\"),\n description: tr(\n \"export.create.entities.projects.description\",\n \"Projects and their metadata\",\n ),\n },\n tasks: {\n label: tr(\"export.create.entities.tasks.label\", \"Tasks\"),\n description: tr(\n \"export.create.entities.tasks.description\",\n \"Task items and assignments\",\n ),\n },\n files: {\n label: tr(\"export.create.entities.files.label\", \"Files\"),\n description: tr(\n \"export.create.entities.files.description\",\n \"File metadata and references\",\n ),\n },\n conversations: {\n label: tr(\"export.create.entities.conversations.label\", \"Conversations\"),\n description: tr(\n \"export.create.entities.conversations.description\",\n \"Chat messages and threads\",\n ),\n },\n tags: {\n label: tr(\"export.create.entities.tags.label\", \"Tags\"),\n description: tr(\n \"export.create.entities.tags.description\",\n \"Tags and vocabularies\",\n ),\n },\n activity: {\n label: tr(\"export.create.entities.activity.label\", \"Activity Logs\"),\n description: tr(\n \"export.create.entities.activity.description\",\n \"Audit trail and activity history\",\n ),\n },\n calendar: {\n label: tr(\"export.create.entities.calendar.label\", \"Calendar Events\"),\n description: tr(\n \"export.create.entities.calendar.description\",\n \"Events and bookings\",\n ),\n },\n };\n\n // Only show enabled entities\n const enabledEntities = availableEntities.filter((e) => e.enabled !== false);\n\n return (\n <PageLayout showHeader={false}>\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n onClick={() => navigate?.(basePath)}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all duration-200 hover:scale-110\"\n aria-label={tr(\n \"export.create.actions.backToDashboard\",\n \"Back to export dashboard\",\n )}\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-primary/10 backdrop-blur-sm\">\n <Download size={24} className=\"text-primary\" />\n </div>\n <h1 className=\"text-2xl sm:text-3xl font-bold\">\n {tr(\"export.create.title\", \"New Export\")}\n </h1>\n </div>\n </div>\n </div>\n\n {/* Step Indicator */}\n <div className=\"flex items-center gap-2 justify-center flex-wrap\">\n {([\"entities\", \"options\", \"review\"] as WizardStep[]).map((s, i) => (\n <div key={s} className=\"flex items-center gap-2\">\n {i > 0 && (\n <ArrowRight size={18} className=\"text-muted-foreground\" />\n )}\n <div\n className={cn(\n \"flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200\",\n step === s\n ? \"bg-primary text-primary-foreground border-primary shadow-md scale-105\"\n : \"bg-muted/50 text-muted-foreground border-border/50\",\n )}\n >\n <div className=\"flex items-center justify-center w-6 h-6 rounded-full bg-background/20 font-bold\">\n {i + 1}\n </div>\n <span className=\"hidden sm:inline capitalize\">\n {s === \"entities\"\n ? tr(\"export.create.steps.entities\", \"Select Data\")\n : s === \"options\"\n ? tr(\"export.create.steps.options\", \"Options\")\n : tr(\"export.create.steps.review\", \"Review\")}\n </span>\n </div>\n </div>\n ))}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-4 text-status-error-text text-sm\">\n {error}\n </div>\n )}\n\n {/* Step 1: Select Entities */}\n {step === \"entities\" && (\n <div className=\"space-y-4\">\n <h2 className=\"text-lg font-bold\">\n {tr(\"export.create.select.title\", \"Select data to export\")}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {tr(\n \"export.create.select.description\",\n \"Choose which entity types to include in your export.\",\n )}\n </p>\n {enabledEntities.length === 0 ? (\n <div className=\"border-2 border-border rounded-xl bg-muted/30 p-6 text-sm text-muted-foreground\">\n {tr(\n \"export.create.select.empty\",\n \"No exportable entity types are configured for this workspace yet.\",\n )}\n </div>\n ) : (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {enabledEntities.map((entity) => {\n const isSelected = selectedEntities.includes(entity.entityType);\n return (\n <button\n key={entity.entityType}\n onClick={() => toggleEntity(entity.entityType)}\n className={cn(\n \"text-left border-2 rounded-xl p-4 transition-all duration-200\",\n isSelected\n ? \"border-primary bg-primary/5 shadow-md\"\n : \"border-border/50 hover:border-primary/30 hover:shadow-sm\",\n )}\n >\n <div className=\"flex items-center justify-between mb-2\">\n <h3 className=\"font-semibold\">\n {fallbackEntityCopy[entity.entityType]?.label ??\n entity.displayName}\n </h3>\n {isSelected && (\n <CheckCircle2 size={18} className=\"text-primary\" />\n )}\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {fallbackEntityCopy[entity.entityType]?.description ??\n entity.description}\n </p>\n {entity.estimatedSize && (\n <p className=\"text-xs text-muted-foreground mt-2\">\n ~{entity.estimatedSize}\n </p>\n )}\n </button>\n );\n })}\n </div>\n )}\n </div>\n )}\n\n {/* Step 2: Configure Options */}\n {step === \"options\" && (\n <div className=\"space-y-6\">\n <div className=\"border-2 border-border/50 rounded-xl p-6 space-y-5\">\n <h2 className=\"text-lg font-bold\">\n {tr(\"export.create.options.title\", \"Export Options\")}\n </h2>\n\n {/* Scope selection */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n {tr(\"export.create.options.scope\", \"Export Scope\")}\n </label>\n <div className=\"grid grid-cols-1 sm:grid-cols-3 gap-3\">\n {SCOPE_OPTIONS.map(({ value, Icon }) => {\n // RBAC: Disable admin scopes if user lacks permission\n const isDisabled =\n (value === \"WORKSPACE_ADMIN\" && !canExportWorkspaceAdmin) ||\n (value === \"ORG_ADMIN\" && !canExportOrgAdmin);\n\n return (\n <button\n key={value}\n type=\"button\"\n onClick={() => !isDisabled && setSelectedScope(value)}\n disabled={isDisabled}\n className={cn(\n \"text-left border-2 rounded-xl p-4 transition-all duration-200\",\n selectedScope === value\n ? \"border-primary bg-primary/5 shadow-md\"\n : isDisabled\n ? \"border-border/30 opacity-50 cursor-not-allowed\"\n : \"border-border/50 hover:border-primary/30 hover:shadow-sm\",\n )}\n title={\n isDisabled\n ? value === \"WORKSPACE_ADMIN\"\n ? \"Workspace admin access required\"\n : \"Organization admin access required\"\n : undefined\n }\n >\n <div className=\"flex items-center justify-between mb-2\">\n <Icon\n size={18}\n className={\n selectedScope === value\n ? \"text-primary\"\n : isDisabled\n ? \"text-muted-foreground/50\"\n : \"text-muted-foreground\"\n }\n />\n {selectedScope === value && (\n <CheckCircle2 size={16} className=\"text-primary\" />\n )}\n {isDisabled && (\n <Lock\n size={14}\n className=\"text-muted-foreground/50\"\n />\n )}\n </div>\n <p className=\"font-semibold text-sm\">\n {getScopeLabel(value)}\n </p>\n <p className=\"text-xs text-muted-foreground mt-1\">\n {getScopeDescription(value)}\n </p>\n </button>\n );\n })}\n </div>\n </div>\n\n {/* Name */}\n <div>\n <label\n htmlFor=\"exportName\"\n className=\"block text-sm font-semibold mb-2\"\n >\n {tr(\"export.create.options.name\", \"Export Name\")}{\" \"}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"exportName\"\n value={exportName}\n onChange={(e) => setExportName(e.target.value)}\n className=\"w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200\"\n placeholder={tr(\n \"export.create.options.namePlaceholder\",\n \"e.g., Monthly User Export\",\n )}\n />\n </div>\n\n {/* Format — only CSV and JSON are supported */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n {tr(\"export.create.options.outputFormat\", \"Output Format\")}\n </label>\n <div className=\"grid grid-cols-2 gap-3\">\n {SUPPORTED_FORMATS.map((format) => {\n const Icon = FORMAT_ICONS[format];\n return (\n <button\n key={format}\n onClick={() => setSelectedFormat(format)}\n className={cn(\n \"flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200\",\n selectedFormat === format\n ? \"border-primary bg-primary/5\"\n : \"border-border/50 hover:border-primary/30\",\n )}\n >\n <Icon\n size={18}\n className={\n selectedFormat === format\n ? \"text-primary\"\n : \"text-muted-foreground\"\n }\n />\n <span className=\"font-medium text-sm\">\n {getFormatDisplayName(format)}\n </span>\n </button>\n );\n })}\n </div>\n </div>\n\n {/* Archive format — only ZIP is supported */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n {tr(\"export.create.options.archiveFormat\", \"Archive Format\")}\n </label>\n <div className=\"flex gap-3\">\n <div\n className={cn(\n \"flex items-center gap-2 border-2 rounded-lg px-4 py-2 border-primary bg-primary/5\",\n )}\n >\n <Package size={16} className=\"text-primary\" />\n <span className=\"font-medium text-sm\">ZIP</span>\n </div>\n </div>\n <p className=\"text-xs text-muted-foreground mt-1.5\">\n {tr(\n \"export.create.options.archiveDescription\",\n \"Exports are packaged as ZIP archives.\",\n )}\n </p>\n </div>\n\n {/* Date range filter — always visible */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n <span className=\"inline-flex items-center gap-1.5\">\n <CalendarRange size={15} />\n {tr(\"export.create.options.dateRange\", \"Date Range\")}{\" \"}\n <span className=\"font-normal text-muted-foreground\">\n {tr(\"export.create.shared.optional\", \"(optional)\")}\n </span>\n </span>\n </label>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n <div>\n <label\n htmlFor=\"dateFrom\"\n className=\"block text-xs text-muted-foreground mb-1\"\n >\n {tr(\"export.create.options.dateFrom\", \"From\")}\n </label>\n <input\n type=\"date\"\n id=\"dateFrom\"\n value={dateRangeStart}\n onChange={(e) => setDateRangeStart(e.target.value)}\n className=\"w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm\"\n />\n </div>\n <div>\n <label\n htmlFor=\"dateTo\"\n className=\"block text-xs text-muted-foreground mb-1\"\n >\n {tr(\"export.create.options.dateTo\", \"To\")}\n </label>\n <input\n type=\"date\"\n id=\"dateTo\"\n value={dateRangeEnd}\n min={dateRangeStart}\n onChange={(e) => setDateRangeEnd(e.target.value)}\n className=\"w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm\"\n />\n </div>\n </div>\n <p className=\"text-xs text-muted-foreground mt-1.5\">\n {tr(\n \"export.create.options.dateRangeDescription\",\n \"Leave blank to export all data regardless of date.\",\n )}\n </p>\n </div>\n\n {/* Optional: Use a template */}\n <div>\n <label className=\"block text-sm font-semibold mb-2\">\n {tr(\n \"export.create.options.basedOnTemplate\",\n \"Based on Template\",\n )}{\" \"}\n <span className=\"font-normal text-muted-foreground\">\n {tr(\"export.create.shared.optional\", \"(optional)\")}\n </span>\n </label>\n {templates.length > 0 ? (\n <select\n value={selectedTemplateId ?? \"\"}\n onChange={(e) =>\n setSelectedTemplateId(e.target.value || undefined)\n }\n className=\"w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"\">\n {tr(\"export.create.options.noTemplate\", \"No template\")}\n </option>\n {templates.map((t) => (\n <option key={t.id} value={t.id}>\n {t.name}\n </option>\n ))}\n </select>\n ) : (\n <p className=\"text-sm text-muted-foreground\">\n {tr(\"export.create.options.noTemplates\", \"No templates yet.\")}{\" \"}\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath + \"/templates\")}\n className=\"text-primary underline-offset-2 hover:underline\"\n >\n {tr(\n \"export.create.options.createTemplateLink\",\n \"Create one\",\n )}\n </button>{\" \"}\n {tr(\n \"export.create.options.reuseTemplateHint\",\n \"to reuse export configurations.\",\n )}\n </p>\n )}\n </div>\n </div>\n </div>\n )}\n\n {/* Step 3: Review */}\n {step === \"review\" && (\n <div className=\"space-y-6\">\n <div className=\"border-2 border-primary/50 rounded-xl bg-primary/5 p-6 space-y-4\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <CheckCircle2 size={20} className=\"text-primary\" />\n {tr(\"export.create.review.title\", \"Review Export\")}\n </h2>\n <dl className=\"space-y-3 text-sm\">\n {[\n {\n label: tr(\"export.create.review.fields.name\", \"Name\"),\n value: exportName,\n },\n {\n label: tr(\"export.create.review.fields.scope\", \"Scope\"),\n value: getScopeLabel(selectedScope),\n },\n {\n label: tr(\n \"export.create.review.fields.entityTypes\",\n \"Entity Types\",\n ),\n value: selectedEntities.join(\", \"),\n },\n {\n label: tr(\"export.create.review.fields.format\", \"Format\"),\n value: getFormatDisplayName(selectedFormat),\n },\n {\n label: tr(\"export.create.review.fields.archive\", \"Archive\"),\n value: \"ZIP\",\n },\n ...(dateRangeStart || dateRangeEnd\n ? [\n {\n label: tr(\n \"export.create.review.fields.dateRange\",\n \"Date Range\",\n ),\n value: [\n dateRangeStart || \"—\",\n dateRangeEnd || \"—\",\n ].join(\" → \"),\n },\n ]\n : []),\n ...(selectedTemplateId\n ? [\n {\n label: tr(\n \"export.create.review.fields.template\",\n \"Template\",\n ),\n value:\n templates.find((t) => t.id === selectedTemplateId)\n ?.name ?? selectedTemplateId,\n },\n ]\n : []),\n ].map(({ label, value }) => (\n <div\n key={label}\n className=\"flex flex-col sm:flex-row sm:justify-between gap-1\"\n >\n <dt className=\"text-muted-foreground\">{label}</dt>\n <dd className=\"font-semibold sm:text-right break-words\">\n {value}\n </dd>\n </div>\n ))}\n </dl>\n </div>\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex flex-col sm:flex-row gap-3 pt-2\">\n <button\n onClick={handleBack}\n className=\"px-6 py-3 border-2 border-border/50 rounded-lg hover:bg-accent hover:border-primary/30 transition-all duration-200 font-medium\"\n >\n {step === \"entities\"\n ? tr(\"export.create.actions.cancel\", \"Cancel\")\n : tr(\"export.create.actions.back\", \"Back\")}\n </button>\n {step === \"review\" ? (\n <button\n onClick={handleSubmit}\n disabled={isPending}\n className=\"flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all duration-200 hover:scale-105 font-bold shadow-lg disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {isPending ? (\n <Loader2 size={18} className=\"animate-spin\" />\n ) : (\n <Download size={18} />\n )}\n {tr(\"export.create.actions.startExport\", \"Start Export\")}\n </button>\n ) : (\n <button\n onClick={handleNext}\n className=\"flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all duration-200 hover:scale-105 font-bold shadow-lg\"\n >\n {tr(\"export.create.actions.next\", \"Next\")}\n <ArrowRight size={18} />\n </button>\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,IAAM,IAAoC,CAAC,OAAO,OAAO,EAEnD,KAAsD;CAC1D,KAAK;CACL,MAAM;CACP,EAMK,KAKD;CACH;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,aACE;EACF,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,aACE;EACF,MAAM;EACP;CACF;AAED,SAAgB,IAAmB;CACjC,IAAM,EAAE,cAAW,KAAK,aAAU,sBAAmB,GAAW,EAC1D,EAAE,SAAM,GAAS,EACjB,KACJ,GACA,GACA,MACG,EAAc,GAAG,GAAK,GAAU,EAAO,EACtC,EAAE,cAAW,iBAAc,GAAoB,EAC/C,EAAE,MAAM,MAAsB,GAAsB,EACpD,EAAE,MAAM,MAAc,GAAoB,EAC1C,CAAC,KAAgB,GAAiB,EAGlC,IAA0B,EAAc,yBAAyB,EACjE,KAAoB,EAAc,mBAAmB,EAErD,CAAC,GAAM,KAAW,EAAqB,WAAW,EAClD,CAAC,GAAkB,KAAuB,EAAmB,EAAE,CAAC,EAChE,CAAC,GAAY,KAAiB,EAAS,GAAG,EAC1C,CAAC,GAAgB,KAAqB,EAAuB,MAAM,EACnE,CAAC,GAAe,KAAoB,EAAsB,aA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1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-export",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.519.1",
|
|
4
4
|
"description": "Burdenoff Export Microfrontend - Data export management interface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@apollo/client": "^4.0.11",
|
|
43
|
-
"@burdenoff/fe-libs": "2026.
|
|
43
|
+
"@burdenoff/fe-libs": "2026.518.7",
|
|
44
44
|
"@tanstack/react-query": "^5.90.16",
|
|
45
45
|
"clsx": "^2.1.1",
|
|
46
46
|
"graphql": "^16.10.0",
|