@burdenoff/microfe-admin 2026.829.1 → 2026.829.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/AdminRoot.js +77 -72
- package/dist/admin/AdminRoot.js.map +1 -1
- package/dist/admin/components/TenantMembersPanel.js +105 -106
- package/dist/admin/components/TenantMembersPanel.js.map +1 -1
- package/dist/admin/hooks/useTr.js +14 -0
- package/dist/admin/hooks/useTr.js.map +1 -0
- package/dist/admin/pages/DashboardPage.js +71 -72
- package/dist/admin/pages/DashboardPage.js.map +1 -1
- package/dist/admin/pages/OrganizationsListPage.js +63 -62
- package/dist/admin/pages/OrganizationsListPage.js.map +1 -1
- package/dist/admin/pages/TenantDetailPage.js +148 -149
- package/dist/admin/pages/TenantDetailPage.js.map +1 -1
- package/dist/admin/pages/TenantsListPage.js +106 -107
- package/dist/admin/pages/TenantsListPage.js.map +1 -1
- package/dist/admin/pages/UsersListPage.js +87 -88
- package/dist/admin/pages/UsersListPage.js.map +1 -1
- package/package.json +1 -1
package/dist/admin/AdminRoot.js
CHANGED
|
@@ -1,183 +1,188 @@
|
|
|
1
1
|
import { AdminProvider as e } from "./providers/AdminProvider.js";
|
|
2
2
|
import { joinPath as t } from "./utils/navigation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { useTr as n } from "./hooks/useTr.js";
|
|
4
|
+
import { AdminRoutes as r } from "./AdminRoutes.js";
|
|
5
|
+
import { useEffect as i } from "react";
|
|
6
|
+
import { AlertOctagon as a, Box as o, Building as s, Building2 as c, CreditCard as l, FileText as u, GitBranch as d, Layout as f, LayoutDashboard as p, Link2 as m, Mail as h, Server as g, Settings as _, ShieldCheck as v, ToggleLeft as y, Users as b } from "lucide-react";
|
|
7
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
8
|
+
import { FeatureFlagProvider as S } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
8
9
|
//#region src/admin/AdminRoot.tsx
|
|
9
|
-
var
|
|
10
|
-
let { registerNavItems:
|
|
11
|
-
return
|
|
12
|
-
if (
|
|
10
|
+
var C = (C) => {
|
|
11
|
+
let { registerNavItems: w, registerFooterItems: T, basePath: E = "", workspaceId: D } = C, O = n();
|
|
12
|
+
return i(() => {
|
|
13
|
+
if (w) return w([
|
|
13
14
|
{
|
|
14
15
|
id: "admin-dashboard",
|
|
15
|
-
label: "Dashboard",
|
|
16
|
-
path: t(
|
|
17
|
-
icon: /* @__PURE__ */
|
|
16
|
+
label: O("admin.nav.dashboard", "Dashboard"),
|
|
17
|
+
path: t(E, "dashboard"),
|
|
18
|
+
icon: /* @__PURE__ */ x(p, { size: 20 }),
|
|
18
19
|
order: 10,
|
|
19
20
|
group: "admin"
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
23
|
id: "admin-tenants",
|
|
23
|
-
label: "Tenants",
|
|
24
|
-
path: t(
|
|
25
|
-
icon: /* @__PURE__ */
|
|
24
|
+
label: O("admin.nav.tenants", "Tenants"),
|
|
25
|
+
path: t(E, "tenants"),
|
|
26
|
+
icon: /* @__PURE__ */ x(c, { size: 20 }),
|
|
26
27
|
order: 20,
|
|
27
28
|
group: "admin"
|
|
28
29
|
},
|
|
29
30
|
{
|
|
30
31
|
id: "admin-organizations",
|
|
31
|
-
label: "Organizations",
|
|
32
|
-
path: t(
|
|
33
|
-
icon: /* @__PURE__ */
|
|
32
|
+
label: O("admin.nav.organizations", "Organizations"),
|
|
33
|
+
path: t(E, "organizations"),
|
|
34
|
+
icon: /* @__PURE__ */ x(s, { size: 20 }),
|
|
34
35
|
order: 25,
|
|
35
36
|
group: "admin"
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
id: "admin-workspaces",
|
|
39
|
-
label: "Workspaces",
|
|
40
|
-
path: t(
|
|
41
|
-
icon: /* @__PURE__ */
|
|
40
|
+
label: O("admin.nav.workspaces", "Workspaces"),
|
|
41
|
+
path: t(E, "workspaces"),
|
|
42
|
+
icon: /* @__PURE__ */ x(f, { size: 20 }),
|
|
42
43
|
order: 26,
|
|
43
44
|
group: "admin"
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
47
|
id: "admin-users",
|
|
47
|
-
label: "Users",
|
|
48
|
-
path: t(
|
|
49
|
-
icon: /* @__PURE__ */ b
|
|
48
|
+
label: O("admin.nav.users", "Users"),
|
|
49
|
+
path: t(E, "users"),
|
|
50
|
+
icon: /* @__PURE__ */ x(b, { size: 20 }),
|
|
50
51
|
order: 30,
|
|
51
52
|
group: "admin"
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
55
|
id: "admin-roles",
|
|
55
|
-
label: "Roles & Permissions",
|
|
56
|
-
path: t(
|
|
57
|
-
icon: /* @__PURE__ */
|
|
56
|
+
label: O("admin.nav.rolesAndPermissions", "Roles & Permissions"),
|
|
57
|
+
path: t(E, "roles"),
|
|
58
|
+
icon: /* @__PURE__ */ x(v, { size: 20 }),
|
|
58
59
|
order: 35,
|
|
59
60
|
group: "admin"
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
id: "admin-billing",
|
|
63
|
-
label: "Billing",
|
|
64
|
-
path: t(
|
|
65
|
-
icon: /* @__PURE__ */
|
|
64
|
+
label: O("admin.nav.billing", "Billing"),
|
|
65
|
+
path: t(E, "billing"),
|
|
66
|
+
icon: /* @__PURE__ */ x(l, { size: 20 }),
|
|
66
67
|
order: 40,
|
|
67
68
|
group: "admin",
|
|
68
69
|
children: [
|
|
69
70
|
{
|
|
70
71
|
id: "admin-billing-subscriptions",
|
|
71
|
-
label: "Subscriptions",
|
|
72
|
-
path: t(
|
|
72
|
+
label: O("admin.nav.subscriptions", "Subscriptions"),
|
|
73
|
+
path: t(E, "billing/subscriptions"),
|
|
73
74
|
order: 1
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
id: "admin-billing-invoices",
|
|
77
|
-
label: "Invoices",
|
|
78
|
-
path: t(
|
|
78
|
+
label: O("admin.nav.invoices", "Invoices"),
|
|
79
|
+
path: t(E, "billing/invoices"),
|
|
79
80
|
order: 2
|
|
80
81
|
},
|
|
81
82
|
{
|
|
82
83
|
id: "admin-billing-plans",
|
|
83
|
-
label: "Plans",
|
|
84
|
-
path: t(
|
|
84
|
+
label: O("admin.nav.plans", "Plans"),
|
|
85
|
+
path: t(E, "billing/plans"),
|
|
85
86
|
order: 3
|
|
86
87
|
}
|
|
87
88
|
]
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
id: "admin-communications",
|
|
91
|
-
label: "Communications",
|
|
92
|
-
path: t(
|
|
93
|
-
icon: /* @__PURE__ */
|
|
92
|
+
label: O("admin.nav.communications", "Communications"),
|
|
93
|
+
path: t(E, "communications"),
|
|
94
|
+
icon: /* @__PURE__ */ x(h, { size: 20 }),
|
|
94
95
|
order: 50,
|
|
95
96
|
group: "admin"
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
99
|
id: "admin-feature-flags",
|
|
99
|
-
label: "Feature Flags",
|
|
100
|
-
path: t(
|
|
101
|
-
icon: /* @__PURE__ */
|
|
100
|
+
label: O("admin.nav.featureFlags", "Feature Flags"),
|
|
101
|
+
path: t(E, "feature-flags"),
|
|
102
|
+
icon: /* @__PURE__ */ x(y, { size: 20 }),
|
|
102
103
|
order: 60,
|
|
103
104
|
group: "admin"
|
|
104
105
|
},
|
|
105
106
|
{
|
|
106
107
|
id: "admin-workflows",
|
|
107
|
-
label: "Workflows",
|
|
108
|
-
path: t(
|
|
109
|
-
icon: /* @__PURE__ */
|
|
108
|
+
label: O("admin.nav.workflows", "Workflows"),
|
|
109
|
+
path: t(E, "workflows"),
|
|
110
|
+
icon: /* @__PURE__ */ x(d, { size: 20 }),
|
|
110
111
|
order: 70,
|
|
111
112
|
group: "admin"
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
115
|
id: "admin-sre",
|
|
115
|
-
label: "SRE",
|
|
116
|
-
path: t(
|
|
117
|
-
icon: /* @__PURE__ */
|
|
116
|
+
label: O("admin.nav.sre", "SRE"),
|
|
117
|
+
path: t(E, "sre"),
|
|
118
|
+
icon: /* @__PURE__ */ x(g, { size: 20 }),
|
|
118
119
|
order: 80,
|
|
119
120
|
group: "admin"
|
|
120
121
|
},
|
|
121
122
|
{
|
|
122
123
|
id: "admin-sync-failures",
|
|
123
|
-
label: "Sync Failures",
|
|
124
|
-
path: t(
|
|
125
|
-
icon: /* @__PURE__ */
|
|
124
|
+
label: O("admin.nav.syncFailures", "Sync Failures"),
|
|
125
|
+
path: t(E, "sync-failures"),
|
|
126
|
+
icon: /* @__PURE__ */ x(a, { size: 20 }),
|
|
126
127
|
order: 82,
|
|
127
128
|
group: "admin"
|
|
128
129
|
},
|
|
129
130
|
{
|
|
130
131
|
id: "admin-audit",
|
|
131
|
-
label: "Audit Logs",
|
|
132
|
-
path: t(
|
|
133
|
-
icon: /* @__PURE__ */
|
|
132
|
+
label: O("admin.nav.auditLogs", "Audit Logs"),
|
|
133
|
+
path: t(E, "audit"),
|
|
134
|
+
icon: /* @__PURE__ */ x(u, { size: 20 }),
|
|
134
135
|
order: 85,
|
|
135
136
|
group: "admin"
|
|
136
137
|
},
|
|
137
138
|
{
|
|
138
139
|
id: "admin-referrals",
|
|
139
|
-
label: "Referrals",
|
|
140
|
-
path: t(
|
|
141
|
-
icon: /* @__PURE__ */
|
|
140
|
+
label: O("admin.nav.referrals", "Referrals"),
|
|
141
|
+
path: t(E, "referrals"),
|
|
142
|
+
icon: /* @__PURE__ */ x(m, { size: 20 }),
|
|
142
143
|
order: 86,
|
|
143
144
|
group: "admin"
|
|
144
145
|
},
|
|
145
146
|
{
|
|
146
147
|
id: "admin-sandbox",
|
|
147
|
-
label: "Sandbox",
|
|
148
|
-
path: t(
|
|
149
|
-
icon: /* @__PURE__ */
|
|
148
|
+
label: O("admin.nav.sandbox", "Sandbox"),
|
|
149
|
+
path: t(E, "sandbox"),
|
|
150
|
+
icon: /* @__PURE__ */ x(o, { size: 20 }),
|
|
150
151
|
order: 87,
|
|
151
152
|
group: "admin"
|
|
152
153
|
},
|
|
153
154
|
{
|
|
154
155
|
id: "admin-settings",
|
|
155
|
-
label: "Settings",
|
|
156
|
-
path: t(
|
|
157
|
-
icon: /* @__PURE__ */
|
|
156
|
+
label: O("admin.nav.settings", "Settings"),
|
|
157
|
+
path: t(E, "settings"),
|
|
158
|
+
icon: /* @__PURE__ */ x(_, { size: 20 }),
|
|
158
159
|
order: 90,
|
|
159
160
|
group: "admin"
|
|
160
161
|
}
|
|
161
162
|
]);
|
|
162
|
-
}, [
|
|
163
|
-
|
|
163
|
+
}, [
|
|
164
|
+
w,
|
|
165
|
+
E,
|
|
166
|
+
O
|
|
167
|
+
]), i(() => {
|
|
168
|
+
if (T) return T([{
|
|
164
169
|
id: "admin-status",
|
|
165
|
-
label: "Admin Console Ready",
|
|
170
|
+
label: O("admin.footer.status", "Admin Console Ready"),
|
|
166
171
|
type: "status",
|
|
167
172
|
order: 10,
|
|
168
173
|
section: "left"
|
|
169
174
|
}]);
|
|
170
|
-
}, [
|
|
171
|
-
workspaceId:
|
|
175
|
+
}, [T, O]), /* @__PURE__ */ x(S, {
|
|
176
|
+
workspaceId: D || null,
|
|
172
177
|
gateway: "global",
|
|
173
178
|
defaultEnabled: !0,
|
|
174
|
-
children: /* @__PURE__ */
|
|
175
|
-
...
|
|
176
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ x(e, {
|
|
180
|
+
...C,
|
|
181
|
+
children: /* @__PURE__ */ x(r, {})
|
|
177
182
|
})
|
|
178
183
|
});
|
|
179
184
|
};
|
|
180
185
|
//#endregion
|
|
181
|
-
export {
|
|
186
|
+
export { C as AdminRoot };
|
|
182
187
|
|
|
183
188
|
//# sourceMappingURL=AdminRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminRoot.js","names":[],"sources":["../../src/admin/AdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport {\n LayoutDashboard,\n Building2,\n Users,\n CreditCard,\n Settings,\n Server,\n Mail,\n FileText,\n Box,\n Building,\n Layout,\n ToggleLeft,\n ShieldCheck,\n GitBranch,\n Link2,\n AlertOctagon,\n} from 'lucide-react';\nimport { AdminProvider } from './providers/AdminProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, AdminRootProps } from './types';\nimport { AdminRoutes } from './AdminRoutes';\nimport { joinPath } from './utils/navigation';\n\n/**\n * Root component for the Admin 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 { AdminRoot, type AdminRootProps } from '@burdenoff/microfe-admin';\n *\n * function App() {\n * const props: AdminRootProps = {\n * basePath: '/admin',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'admin@example.com', role: 'PLATFORM_SUPERADMIN' },\n * tenantId: 'tenant-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <AdminRoot {...props} />;\n * }\n * ```\n */\nexport const AdminRoot: FC<AdminRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '', workspaceId } = props;\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'admin-dashboard',\n label: 'Dashboard',\n path: joinPath(basePath, 'dashboard'),\n icon: <LayoutDashboard size={20} />,\n order: 10,\n group: 'admin',\n },\n {\n id: 'admin-tenants',\n label: 'Tenants',\n path: joinPath(basePath, 'tenants'),\n icon: <Building2 size={20} />,\n order: 20,\n group: 'admin',\n },\n {\n id: 'admin-organizations',\n label: 'Organizations',\n path: joinPath(basePath, 'organizations'),\n icon: <Building size={20} />,\n order: 25,\n group: 'admin',\n },\n {\n id: 'admin-workspaces',\n label: 'Workspaces',\n path: joinPath(basePath, 'workspaces'),\n icon: <Layout size={20} />,\n order: 26,\n group: 'admin',\n },\n {\n id: 'admin-users',\n label: 'Users',\n path: joinPath(basePath, 'users'),\n icon: <Users size={20} />,\n order: 30,\n group: 'admin',\n },\n {\n id: 'admin-roles',\n label: 'Roles & Permissions',\n path: joinPath(basePath, 'roles'),\n icon: <ShieldCheck size={20} />,\n order: 35,\n group: 'admin',\n },\n {\n id: 'admin-billing',\n label: 'Billing',\n path: joinPath(basePath, 'billing'),\n icon: <CreditCard size={20} />,\n order: 40,\n group: 'admin',\n children: [\n {\n id: 'admin-billing-subscriptions',\n label: 'Subscriptions',\n path: joinPath(basePath, 'billing/subscriptions'),\n order: 1,\n },\n {\n id: 'admin-billing-invoices',\n label: 'Invoices',\n path: joinPath(basePath, 'billing/invoices'),\n order: 2,\n },\n {\n id: 'admin-billing-plans',\n label: 'Plans',\n path: joinPath(basePath, 'billing/plans'),\n order: 3,\n },\n ],\n },\n {\n id: 'admin-communications',\n label: 'Communications',\n path: joinPath(basePath, 'communications'),\n icon: <Mail size={20} />,\n order: 50,\n group: 'admin',\n },\n {\n id: 'admin-feature-flags',\n label: 'Feature Flags',\n path: joinPath(basePath, 'feature-flags'),\n icon: <ToggleLeft size={20} />,\n order: 60,\n group: 'admin',\n },\n {\n id: 'admin-workflows',\n label: 'Workflows',\n path: joinPath(basePath, 'workflows'),\n icon: <GitBranch size={20} />,\n order: 70,\n group: 'admin',\n },\n {\n id: 'admin-sre',\n label: 'SRE',\n path: joinPath(basePath, 'sre'),\n icon: <Server size={20} />,\n order: 80,\n group: 'admin',\n },\n {\n id: 'admin-sync-failures',\n label: 'Sync Failures',\n path: joinPath(basePath, 'sync-failures'),\n icon: <AlertOctagon size={20} />,\n order: 82,\n group: 'admin',\n },\n {\n id: 'admin-audit',\n label: 'Audit Logs',\n path: joinPath(basePath, 'audit'),\n icon: <FileText size={20} />,\n order: 85,\n group: 'admin',\n },\n {\n id: 'admin-referrals',\n label: 'Referrals',\n path: joinPath(basePath, 'referrals'),\n icon: <Link2 size={20} />,\n order: 86,\n group: 'admin',\n },\n {\n id: 'admin-sandbox',\n label: 'Sandbox',\n path: joinPath(basePath, 'sandbox'),\n icon: <Box size={20} />,\n order: 87,\n group: 'admin',\n },\n {\n id: 'admin-settings',\n label: 'Settings',\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 90,\n group: 'admin',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\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: 'admin-status',\n label: 'Admin Console 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 workspaceId={workspaceId || null} gateway=\"global\" defaultEnabled={true}>\n <AdminProvider {...props}>\n <AdminRoutes />\n </AdminProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;AAoDA,IAAa,KAAiC,MAAU;CACtD,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,IAAI,mBAAgB;AAsL9E,QAnLA,QAAgB;AACT,QA6JL,QAHgB,EAxJY;GAC1B;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAiB,MAAM,IAAM,CAAA;IACnC,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,UAAU;IACnC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;IAC7B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,gBAAgB;IACzC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAA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P,MAAM,EAAS,GAAU,MAAM;IAC/B,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;IAC1B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,gBAAgB;IACzC,MAAM,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA;IAChC,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,QAAQ;IACjC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;IACzB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,UAAU;IACnC,MAAM,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;IACvB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,WAAW;IACpC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACF,CAGyC;IAIzC,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;EAAqB,aAAa,KAAe;EAAM,SAAQ;EAAS,gBAAgB;YACtF,kBAAC,GAAD;GAAe,GAAI;aACjB,kBAAC,GAAD,EAAe,CAAA;GACD,CAAA;EACI,CAAA"}
|
|
1
|
+
{"version":3,"file":"AdminRoot.js","names":[],"sources":["../../src/admin/AdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport {\n LayoutDashboard,\n Building2,\n Users,\n CreditCard,\n Settings,\n Server,\n Mail,\n FileText,\n Box,\n Building,\n Layout,\n ToggleLeft,\n ShieldCheck,\n GitBranch,\n Link2,\n AlertOctagon,\n} from 'lucide-react';\nimport { AdminProvider } from './providers/AdminProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, AdminRootProps } from './types';\nimport { AdminRoutes } from './AdminRoutes';\nimport { joinPath } from './utils/navigation';\nimport { useTr } from './hooks/useTr';\n\n/**\n * Root component for the Admin 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 { AdminRoot, type AdminRootProps } from '@burdenoff/microfe-admin';\n *\n * function App() {\n * const props: AdminRootProps = {\n * basePath: '/admin',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'admin@example.com', role: 'PLATFORM_SUPERADMIN' },\n * tenantId: 'tenant-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <AdminRoot {...props} />;\n * }\n * ```\n */\nexport const AdminRoot: FC<AdminRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '', workspaceId } = props;\n const tr = useTr();\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'admin-dashboard',\n label: tr('admin.nav.dashboard', 'Dashboard'),\n path: joinPath(basePath, 'dashboard'),\n icon: <LayoutDashboard size={20} />,\n order: 10,\n group: 'admin',\n },\n {\n id: 'admin-tenants',\n label: tr('admin.nav.tenants', 'Tenants'),\n path: joinPath(basePath, 'tenants'),\n icon: <Building2 size={20} />,\n order: 20,\n group: 'admin',\n },\n {\n id: 'admin-organizations',\n label: tr('admin.nav.organizations', 'Organizations'),\n path: joinPath(basePath, 'organizations'),\n icon: <Building size={20} />,\n order: 25,\n group: 'admin',\n },\n {\n id: 'admin-workspaces',\n label: tr('admin.nav.workspaces', 'Workspaces'),\n path: joinPath(basePath, 'workspaces'),\n icon: <Layout size={20} />,\n order: 26,\n group: 'admin',\n },\n {\n id: 'admin-users',\n label: tr('admin.nav.users', 'Users'),\n path: joinPath(basePath, 'users'),\n icon: <Users size={20} />,\n order: 30,\n group: 'admin',\n },\n {\n id: 'admin-roles',\n label: tr('admin.nav.rolesAndPermissions', 'Roles & Permissions'),\n path: joinPath(basePath, 'roles'),\n icon: <ShieldCheck size={20} />,\n order: 35,\n group: 'admin',\n },\n {\n id: 'admin-billing',\n label: tr('admin.nav.billing', 'Billing'),\n path: joinPath(basePath, 'billing'),\n icon: <CreditCard size={20} />,\n order: 40,\n group: 'admin',\n children: [\n {\n id: 'admin-billing-subscriptions',\n label: tr('admin.nav.subscriptions', 'Subscriptions'),\n path: joinPath(basePath, 'billing/subscriptions'),\n order: 1,\n },\n {\n id: 'admin-billing-invoices',\n label: tr('admin.nav.invoices', 'Invoices'),\n path: joinPath(basePath, 'billing/invoices'),\n order: 2,\n },\n {\n id: 'admin-billing-plans',\n label: tr('admin.nav.plans', 'Plans'),\n path: joinPath(basePath, 'billing/plans'),\n order: 3,\n },\n ],\n },\n {\n id: 'admin-communications',\n label: tr('admin.nav.communications', 'Communications'),\n path: joinPath(basePath, 'communications'),\n icon: <Mail size={20} />,\n order: 50,\n group: 'admin',\n },\n {\n id: 'admin-feature-flags',\n label: tr('admin.nav.featureFlags', 'Feature Flags'),\n path: joinPath(basePath, 'feature-flags'),\n icon: <ToggleLeft size={20} />,\n order: 60,\n group: 'admin',\n },\n {\n id: 'admin-workflows',\n label: tr('admin.nav.workflows', 'Workflows'),\n path: joinPath(basePath, 'workflows'),\n icon: <GitBranch size={20} />,\n order: 70,\n group: 'admin',\n },\n {\n id: 'admin-sre',\n label: tr('admin.nav.sre', 'SRE'),\n path: joinPath(basePath, 'sre'),\n icon: <Server size={20} />,\n order: 80,\n group: 'admin',\n },\n {\n id: 'admin-sync-failures',\n label: tr('admin.nav.syncFailures', 'Sync Failures'),\n path: joinPath(basePath, 'sync-failures'),\n icon: <AlertOctagon size={20} />,\n order: 82,\n group: 'admin',\n },\n {\n id: 'admin-audit',\n label: tr('admin.nav.auditLogs', 'Audit Logs'),\n path: joinPath(basePath, 'audit'),\n icon: <FileText size={20} />,\n order: 85,\n group: 'admin',\n },\n {\n id: 'admin-referrals',\n label: tr('admin.nav.referrals', 'Referrals'),\n path: joinPath(basePath, 'referrals'),\n icon: <Link2 size={20} />,\n order: 86,\n group: 'admin',\n },\n {\n id: 'admin-sandbox',\n label: tr('admin.nav.sandbox', 'Sandbox'),\n path: joinPath(basePath, 'sandbox'),\n icon: <Box size={20} />,\n order: 87,\n group: 'admin',\n },\n {\n id: 'admin-settings',\n label: tr('admin.nav.settings', 'Settings'),\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 90,\n group: 'admin',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath, tr]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'admin-status',\n label: tr('admin.footer.status', 'Admin Console 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, tr]);\n\n return (\n <FeatureFlagProvider workspaceId={workspaceId || null} gateway=\"global\" defaultEnabled={true}>\n <AdminProvider {...props}>\n <AdminRoutes />\n </AdminProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;AAqDA,IAAa,KAAiC,MAAU;CACtD,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,IAAI,mBAAgB,GACxE,IAAK,GAAO;AAsLlB,QAnLA,QAAgB;AACT,QA6JL,QAHgB,EAxJY;GAC1B;IACE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