@burdenoff/microfe-auth 2026.710.2 → 2026.717.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.
- package/dist/auth/hooks/useContextSwitcherData.js +176 -151
- package/dist/auth/hooks/useContextSwitcherData.js.map +1 -1
- package/dist/auth/pages/AuditLogPage.js +106 -90
- package/dist/auth/pages/AuditLogPage.js.map +1 -1
- package/dist/auth/pages/MfaSetupPage.js +4 -4
- package/dist/auth/pages/UserDetailsPage.js +135 -120
- package/dist/auth/pages/UserDetailsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,15 +2,16 @@ import { useAuthStore as e } from "../store/authStore.js";
|
|
|
2
2
|
import { AlertIcon as t, SpinnerIcon as n } from "../components/AuthIcons.js";
|
|
3
3
|
import { useUserOperations as r } from "../hooks/useUserOperations.js";
|
|
4
4
|
import { useAuthPermissions as i } from "../hooks/useAuthPermissions.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ConfirmActionDialog as a } from "../components/ConfirmActionDialog.js";
|
|
6
|
+
import { useCreateAuthExportJobMutation as o } from "../../generated/wspace-operations.js";
|
|
7
7
|
import { useEffect as s, useState as c } from "react";
|
|
8
8
|
import { useNavigate as l, useParams as u } from "react-router-dom";
|
|
9
9
|
import { useI18n as d } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
10
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
|
-
import {
|
|
11
|
+
import { isQuotaExhaustedError as h } from "@burdenoff/fe-libs/shared/utils";
|
|
12
|
+
import { EmphasisPanel as g, IllustratedEmptyState as _, NextSteps as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
//#region src/auth/pages/UserDetailsPage.tsx
|
|
13
|
-
var
|
|
14
|
+
var b = (e) => {
|
|
14
15
|
switch (e) {
|
|
15
16
|
case "SUPER_ADMIN": return "bg-accent-purple-subtle text-accent-purple";
|
|
16
17
|
case "TENANT_ADMIN": return "bg-status-info-bg-subtle text-status-info-text";
|
|
@@ -20,7 +21,7 @@ var y = (e) => {
|
|
|
20
21
|
case "GUEST": return "bg-bg-sunken text-text-primary";
|
|
21
22
|
default: return "bg-bg-sunken text-text-primary";
|
|
22
23
|
}
|
|
23
|
-
},
|
|
24
|
+
}, x = (e) => {
|
|
24
25
|
switch (e) {
|
|
25
26
|
case "ACTIVE": return "bg-status-success-bg-subtle text-status-success-text";
|
|
26
27
|
case "INACTIVE": return "bg-status-warning-bg-subtle text-status-warning-text";
|
|
@@ -29,59 +30,59 @@ var y = (e) => {
|
|
|
29
30
|
default: return "bg-bg-sunken text-text-primary";
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
|
-
function
|
|
33
|
-
let { id:
|
|
34
|
-
let n =
|
|
33
|
+
function S() {
|
|
34
|
+
let { id: S } = u(), C = l(), { t: w } = d(), T = (e, t) => {
|
|
35
|
+
let n = w(e);
|
|
35
36
|
return n === e ? t : n;
|
|
36
|
-
},
|
|
37
|
+
}, E = e((e) => e.isAuthenticated), D = e((e) => e.user), { canViewUsers: O, canDeleteUsers: k, isLoading: A } = i(), { getUser: j, deleteUser: M, hardDeleteUser: N } = r(), [P, F] = c(null), [I, L] = c(!0), [R, z] = c(null), [B, V] = c(null), [H, U] = c(null), [W, { loading: G }] = o(), [K, q] = c(null), [J, Y] = c(!1);
|
|
37
38
|
s(() => {
|
|
38
39
|
let e = !1;
|
|
39
|
-
if (!
|
|
40
|
-
|
|
40
|
+
if (!S) {
|
|
41
|
+
z("Missing user id"), L(!1);
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
if (!
|
|
44
|
-
|
|
44
|
+
if (!E) {
|
|
45
|
+
L(!1);
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
return
|
|
48
|
-
e || (t ?
|
|
48
|
+
return L(!0), z(null), j(S).then((t) => {
|
|
49
|
+
e || (t ? F(t) : z(T("auth.userDetails.userNotFound", "User not found")));
|
|
49
50
|
}).catch((t) => {
|
|
50
|
-
e ||
|
|
51
|
+
e || z(t instanceof Error ? t.message : "Failed to fetch user details");
|
|
51
52
|
}).finally(() => {
|
|
52
|
-
e ||
|
|
53
|
+
e || L(!1);
|
|
53
54
|
}), () => {
|
|
54
55
|
e = !0;
|
|
55
56
|
};
|
|
56
57
|
}, [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
S,
|
|
59
|
+
j,
|
|
60
|
+
E
|
|
60
61
|
]);
|
|
61
|
-
let
|
|
62
|
-
if (
|
|
63
|
-
let e = await
|
|
62
|
+
let X = async () => {
|
|
63
|
+
if (P) try {
|
|
64
|
+
let e = await M(P.id);
|
|
64
65
|
if (e.success) {
|
|
65
|
-
|
|
66
|
-
let e = await
|
|
67
|
-
e &&
|
|
68
|
-
} else
|
|
66
|
+
V(T("auth.userDetails.userDeactivated", "User \"{email}\" has been deactivated.").replace("{email}", P.email)), U(null);
|
|
67
|
+
let e = await j(P.id);
|
|
68
|
+
e && F(e);
|
|
69
|
+
} else z(e.message);
|
|
69
70
|
} catch (e) {
|
|
70
|
-
|
|
71
|
+
z(e instanceof Error ? e.message : "Failed to delete user");
|
|
71
72
|
}
|
|
72
|
-
},
|
|
73
|
-
if (
|
|
74
|
-
let e = await
|
|
75
|
-
e.success ? (
|
|
73
|
+
}, Z = async () => {
|
|
74
|
+
if (P) try {
|
|
75
|
+
let e = await N(P.id);
|
|
76
|
+
e.success ? (U(null), C("/auth/users")) : z(e.message);
|
|
76
77
|
} catch (e) {
|
|
77
|
-
|
|
78
|
+
z(e instanceof Error ? e.message : "Failed to hard delete user");
|
|
78
79
|
}
|
|
79
|
-
},
|
|
80
|
-
if (
|
|
81
|
-
|
|
80
|
+
}, Q = async () => {
|
|
81
|
+
if (P) {
|
|
82
|
+
q(null);
|
|
82
83
|
try {
|
|
83
|
-
await
|
|
84
|
-
name: `User Data Export - ${
|
|
84
|
+
await W({ variables: { input: {
|
|
85
|
+
name: `User Data Export - ${P.email}`,
|
|
85
86
|
entityTypes: [
|
|
86
87
|
"user_profile",
|
|
87
88
|
"user_sessions",
|
|
@@ -92,11 +93,15 @@ function x() {
|
|
|
92
93
|
includeMetadata: !0
|
|
93
94
|
} } });
|
|
94
95
|
} catch (e) {
|
|
95
|
-
|
|
96
|
+
if (h(e)) {
|
|
97
|
+
Y(!0), q(T("auth.userDetails.exportQuotaReached", "You have reached your export limit for this month."));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
q(e instanceof Error ? e.message : "Failed to start export");
|
|
96
101
|
}
|
|
97
102
|
}
|
|
98
103
|
};
|
|
99
|
-
return
|
|
104
|
+
return E ? A || I ? /* @__PURE__ */ p("div", {
|
|
100
105
|
className: "max-w-4xl mx-auto p-6",
|
|
101
106
|
children: /* @__PURE__ */ m("div", {
|
|
102
107
|
className: "text-center py-16",
|
|
@@ -107,14 +112,14 @@ function x() {
|
|
|
107
112
|
"aria-hidden": "true"
|
|
108
113
|
}), /* @__PURE__ */ p("p", {
|
|
109
114
|
className: "mt-4 text-text-secondary",
|
|
110
|
-
children:
|
|
115
|
+
children: T("auth.userDetails.loading", "Loading user...")
|
|
111
116
|
})]
|
|
112
117
|
})
|
|
113
|
-
}) :
|
|
118
|
+
}) : O ? R || !P ? /* @__PURE__ */ m("div", {
|
|
114
119
|
className: "max-w-4xl mx-auto p-6",
|
|
115
120
|
children: [/* @__PURE__ */ m("button", {
|
|
116
121
|
type: "button",
|
|
117
|
-
onClick: () =>
|
|
122
|
+
onClick: () => C("/auth/users"),
|
|
118
123
|
className: "mb-6 flex items-center gap-2 text-text-link hover:underline font-medium",
|
|
119
124
|
children: [/* @__PURE__ */ p("svg", {
|
|
120
125
|
className: "size-4",
|
|
@@ -128,36 +133,36 @@ function x() {
|
|
|
128
133
|
strokeWidth: 2,
|
|
129
134
|
d: "M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
130
135
|
})
|
|
131
|
-
}),
|
|
136
|
+
}), T("auth.userDetails.backToUsers", "Back to Users")]
|
|
132
137
|
}), /* @__PURE__ */ p("div", {
|
|
133
138
|
role: "alert",
|
|
134
|
-
children: /* @__PURE__ */ p(
|
|
139
|
+
children: /* @__PURE__ */ p(_, {
|
|
135
140
|
illustration: "empty-search",
|
|
136
|
-
title:
|
|
137
|
-
description:
|
|
141
|
+
title: T("auth.userDetails.userNotFound", "User not found"),
|
|
142
|
+
description: R ?? T("auth.userDetails.userNotFoundDesc", "We couldn't find this user. They may have been removed, or the link is out of date.")
|
|
138
143
|
})
|
|
139
144
|
})]
|
|
140
145
|
}) : /* @__PURE__ */ m("div", {
|
|
141
146
|
className: "max-w-4xl mx-auto p-6",
|
|
142
147
|
children: [
|
|
143
|
-
/* @__PURE__ */ p(
|
|
144
|
-
open:
|
|
148
|
+
/* @__PURE__ */ p(a, {
|
|
149
|
+
open: H !== null,
|
|
145
150
|
onOpenChange: (e) => {
|
|
146
|
-
e ||
|
|
151
|
+
e || U(null);
|
|
147
152
|
},
|
|
148
|
-
title:
|
|
149
|
-
description:
|
|
150
|
-
confirmText:
|
|
151
|
-
variant:
|
|
153
|
+
title: H === "hard-delete" ? T("auth.userDetails.hardDeleteTitle", "Permanently delete user?") : T("auth.userDetails.deactivateTitle", "Deactivate user?"),
|
|
154
|
+
description: H === "hard-delete" ? T("auth.userDetails.hardDeleteDesc", "This permanently deletes \"{email}\" and cannot be undone.").replace("{email}", P.email) : T("auth.userDetails.deactivateDesc", "\"{email}\" will be prevented from signing in until reactivated.").replace("{email}", P.email),
|
|
155
|
+
confirmText: H === "hard-delete" ? T("auth.userDetails.hardDeleteConfirm", "Delete permanently") : T("auth.userDetails.deactivateConfirm", "Deactivate user"),
|
|
156
|
+
variant: H === "hard-delete" ? "danger" : "warning",
|
|
152
157
|
onConfirm: async () => {
|
|
153
|
-
|
|
158
|
+
H === "hard-delete" ? await Z() : H === "deactivate" && await X();
|
|
154
159
|
}
|
|
155
160
|
}),
|
|
156
161
|
/* @__PURE__ */ m("div", {
|
|
157
162
|
className: "flex items-center justify-between mb-6",
|
|
158
163
|
children: [/* @__PURE__ */ m("button", {
|
|
159
164
|
type: "button",
|
|
160
|
-
onClick: () =>
|
|
165
|
+
onClick: () => C("/auth/users"),
|
|
161
166
|
className: "flex items-center gap-2 text-text-link hover:underline font-medium",
|
|
162
167
|
children: [/* @__PURE__ */ p("svg", {
|
|
163
168
|
className: "size-4",
|
|
@@ -171,17 +176,17 @@ function x() {
|
|
|
171
176
|
strokeWidth: 2,
|
|
172
177
|
d: "M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
173
178
|
})
|
|
174
|
-
}),
|
|
179
|
+
}), T("auth.userDetails.backToUsers", "Back to Users")]
|
|
175
180
|
}), /* @__PURE__ */ p("button", {
|
|
176
181
|
type: "button",
|
|
177
|
-
onClick: () => void
|
|
178
|
-
disabled:
|
|
179
|
-
"aria-label":
|
|
182
|
+
onClick: () => void Q(),
|
|
183
|
+
disabled: G,
|
|
184
|
+
"aria-label": T("auth.userDetails.exportAriaLabel", "Export user data"),
|
|
180
185
|
className: "flex items-center gap-2 px-4 py-2.5 rounded-xl border border-border-default text-text-primary bg-bg-surface hover:bg-bg-sunken disabled:opacity-50 disabled:cursor-not-allowed transition-colors font-medium",
|
|
181
|
-
children:
|
|
186
|
+
children: G ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(n, {
|
|
182
187
|
className: "size-4 animate-spin",
|
|
183
188
|
"aria-hidden": "true"
|
|
184
|
-
}),
|
|
189
|
+
}), T("auth.userDetails.exporting", "Exporting...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("svg", {
|
|
185
190
|
className: "size-4",
|
|
186
191
|
fill: "none",
|
|
187
192
|
viewBox: "0 0 24 24",
|
|
@@ -193,14 +198,14 @@ function x() {
|
|
|
193
198
|
strokeWidth: 2,
|
|
194
199
|
d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
|
|
195
200
|
})
|
|
196
|
-
}),
|
|
201
|
+
}), T("auth.userDetails.exportButton", "Export User Data")] })
|
|
197
202
|
})]
|
|
198
203
|
}),
|
|
199
|
-
/* @__PURE__ */ p(
|
|
204
|
+
/* @__PURE__ */ p(y, {
|
|
200
205
|
className: "mb-6",
|
|
201
|
-
children:
|
|
206
|
+
children: T("auth.userDetails.purpose", "The full record for this person — their role, status, verification, and activity. From here you can export their data, deactivate them, or (for super admins) permanently delete a removed account.")
|
|
202
207
|
}),
|
|
203
|
-
|
|
208
|
+
K && /* @__PURE__ */ m("div", {
|
|
204
209
|
role: "alert",
|
|
205
210
|
className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
|
|
206
211
|
children: [/* @__PURE__ */ p(t, {
|
|
@@ -208,50 +213,50 @@ function x() {
|
|
|
208
213
|
"aria-hidden": "true"
|
|
209
214
|
}), /* @__PURE__ */ p("p", {
|
|
210
215
|
className: "text-sm text-status-error-text",
|
|
211
|
-
children:
|
|
216
|
+
children: K
|
|
212
217
|
})]
|
|
213
218
|
}),
|
|
214
|
-
|
|
219
|
+
B && /* @__PURE__ */ m("div", {
|
|
215
220
|
className: "mb-6 p-4 rounded-xl bg-status-success-bg-subtle border border-status-success-border",
|
|
216
221
|
children: [/* @__PURE__ */ p("p", {
|
|
217
222
|
className: "text-status-success-text",
|
|
218
|
-
children:
|
|
223
|
+
children: B
|
|
219
224
|
}), /* @__PURE__ */ p("button", {
|
|
220
225
|
type: "button",
|
|
221
|
-
onClick: () =>
|
|
226
|
+
onClick: () => V(null),
|
|
222
227
|
className: "mt-2 text-sm text-status-success-text hover:underline",
|
|
223
|
-
children:
|
|
228
|
+
children: T("auth.userDetails.dismiss", "Dismiss")
|
|
224
229
|
})]
|
|
225
230
|
}),
|
|
226
231
|
/* @__PURE__ */ m("div", {
|
|
227
232
|
className: "p-6 rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
|
|
228
233
|
children: [
|
|
229
|
-
/* @__PURE__ */ p(
|
|
234
|
+
/* @__PURE__ */ p(g, {
|
|
230
235
|
className: "mb-8",
|
|
231
236
|
children: /* @__PURE__ */ m("div", {
|
|
232
237
|
className: "flex items-center gap-4",
|
|
233
238
|
children: [/* @__PURE__ */ p("div", {
|
|
234
239
|
className: "auth-brand-badge flex size-20 items-center justify-center rounded-full text-3xl font-semibold",
|
|
235
240
|
"aria-hidden": "true",
|
|
236
|
-
children: (
|
|
241
|
+
children: (P.name || P.username || P.email).charAt(0).toUpperCase()
|
|
237
242
|
}), /* @__PURE__ */ m("div", { children: [
|
|
238
243
|
/* @__PURE__ */ p("h1", {
|
|
239
244
|
className: "text-2xl font-semibold text-text-primary",
|
|
240
|
-
children:
|
|
245
|
+
children: P.name || P.username
|
|
241
246
|
}),
|
|
242
247
|
/* @__PURE__ */ p("p", {
|
|
243
248
|
className: "text-text-secondary",
|
|
244
249
|
"data-testid": "user-email",
|
|
245
|
-
children:
|
|
250
|
+
children: P.email
|
|
246
251
|
}),
|
|
247
252
|
/* @__PURE__ */ m("div", {
|
|
248
253
|
className: "flex items-center gap-2 mt-2",
|
|
249
254
|
children: [/* @__PURE__ */ p("span", {
|
|
250
|
-
className: `px-2.5 py-1 rounded-full text-xs font-medium ${
|
|
251
|
-
children:
|
|
255
|
+
className: `px-2.5 py-1 rounded-full text-xs font-medium ${b(P.role)}`,
|
|
256
|
+
children: P.role.replace("_", " ")
|
|
252
257
|
}), /* @__PURE__ */ p("span", {
|
|
253
|
-
className: `px-2.5 py-1 rounded-full text-xs font-medium ${
|
|
254
|
-
children:
|
|
258
|
+
className: `px-2.5 py-1 rounded-full text-xs font-medium ${x(P.status)}`,
|
|
259
|
+
children: P.status
|
|
255
260
|
})]
|
|
256
261
|
})
|
|
257
262
|
] })]
|
|
@@ -264,35 +269,35 @@ function x() {
|
|
|
264
269
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
265
270
|
children: [/* @__PURE__ */ p("dt", {
|
|
266
271
|
className: "text-sm font-medium text-text-secondary mb-1",
|
|
267
|
-
children:
|
|
272
|
+
children: T("auth.userDetails.username", "Username")
|
|
268
273
|
}), /* @__PURE__ */ p("dd", {
|
|
269
274
|
className: "text-text-primary font-medium",
|
|
270
|
-
children:
|
|
275
|
+
children: P.username
|
|
271
276
|
})]
|
|
272
277
|
}),
|
|
273
278
|
/* @__PURE__ */ m("div", {
|
|
274
279
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
275
280
|
children: [/* @__PURE__ */ p("dt", {
|
|
276
281
|
className: "text-sm font-medium text-text-secondary mb-1",
|
|
277
|
-
children:
|
|
282
|
+
children: T("auth.userDetails.email", "Email")
|
|
278
283
|
}), /* @__PURE__ */ p("dd", {
|
|
279
284
|
className: "text-text-primary font-medium",
|
|
280
|
-
children:
|
|
285
|
+
children: P.email
|
|
281
286
|
})]
|
|
282
287
|
}),
|
|
283
288
|
/* @__PURE__ */ m("div", {
|
|
284
289
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
285
290
|
children: [/* @__PURE__ */ p("dt", {
|
|
286
291
|
className: "text-sm font-medium text-text-secondary mb-1",
|
|
287
|
-
children:
|
|
292
|
+
children: T("auth.userDetails.emailVerified", "Email Verified")
|
|
288
293
|
}), /* @__PURE__ */ p("dd", {
|
|
289
294
|
className: "text-text-primary font-medium",
|
|
290
|
-
children:
|
|
295
|
+
children: P.emailVerified ? /* @__PURE__ */ p("span", {
|
|
291
296
|
className: "text-status-success-text",
|
|
292
|
-
children:
|
|
297
|
+
children: T("auth.userDetails.yes", "Yes")
|
|
293
298
|
}) : /* @__PURE__ */ p("span", {
|
|
294
299
|
className: "text-status-warning-text",
|
|
295
|
-
children:
|
|
300
|
+
children: T("auth.userDetails.no", "No")
|
|
296
301
|
})
|
|
297
302
|
})]
|
|
298
303
|
}),
|
|
@@ -300,109 +305,119 @@ function x() {
|
|
|
300
305
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
301
306
|
children: [/* @__PURE__ */ p("dt", {
|
|
302
307
|
className: "text-sm font-medium text-text-secondary mb-1",
|
|
303
|
-
children:
|
|
308
|
+
children: T("auth.userDetails.mfaEnabled", "MFA Enabled")
|
|
304
309
|
}), /* @__PURE__ */ p("dd", {
|
|
305
310
|
className: "text-text-primary font-medium",
|
|
306
|
-
children:
|
|
311
|
+
children: P.mfaEnabled ? /* @__PURE__ */ p("span", {
|
|
307
312
|
className: "text-status-success-text",
|
|
308
|
-
children:
|
|
313
|
+
children: T("auth.userDetails.yes", "Yes")
|
|
309
314
|
}) : /* @__PURE__ */ p("span", {
|
|
310
315
|
className: "text-text-secondary",
|
|
311
|
-
children:
|
|
316
|
+
children: T("auth.userDetails.no", "No")
|
|
312
317
|
})
|
|
313
318
|
})]
|
|
314
319
|
}),
|
|
315
|
-
|
|
320
|
+
P.phoneNumber && /* @__PURE__ */ m("div", {
|
|
316
321
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
317
322
|
children: [/* @__PURE__ */ p("dt", {
|
|
318
323
|
className: "text-sm font-medium text-text-secondary mb-1",
|
|
319
|
-
children:
|
|
324
|
+
children: T("auth.userDetails.phoneNumber", "Phone Number")
|
|
320
325
|
}), /* @__PURE__ */ p("dd", {
|
|
321
326
|
className: "text-text-primary font-medium",
|
|
322
|
-
children:
|
|
327
|
+
children: P.phoneNumber
|
|
323
328
|
})]
|
|
324
329
|
}),
|
|
325
330
|
/* @__PURE__ */ m("div", {
|
|
326
331
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
327
332
|
children: [/* @__PURE__ */ p("dt", {
|
|
328
333
|
className: "text-sm font-medium text-text-secondary mb-1",
|
|
329
|
-
children:
|
|
334
|
+
children: T("auth.userDetails.lastLogin", "Last Login")
|
|
330
335
|
}), /* @__PURE__ */ p("dd", {
|
|
331
336
|
className: "text-text-primary font-medium",
|
|
332
|
-
children:
|
|
337
|
+
children: P.lastLoginAt ? new Date(P.lastLoginAt).toLocaleString() : T("auth.userDetails.never", "Never")
|
|
333
338
|
})]
|
|
334
339
|
}),
|
|
335
340
|
/* @__PURE__ */ m("div", {
|
|
336
341
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
337
342
|
children: [/* @__PURE__ */ p("dt", {
|
|
338
343
|
className: "text-sm font-medium text-text-secondary mb-1",
|
|
339
|
-
children:
|
|
344
|
+
children: T("auth.userDetails.created", "Created")
|
|
340
345
|
}), /* @__PURE__ */ p("dd", {
|
|
341
346
|
className: "text-text-primary font-medium",
|
|
342
|
-
children: new Date(
|
|
347
|
+
children: new Date(P.createdAt).toLocaleString()
|
|
343
348
|
})]
|
|
344
349
|
}),
|
|
345
350
|
/* @__PURE__ */ m("div", {
|
|
346
351
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
347
352
|
children: [/* @__PURE__ */ p("dt", {
|
|
348
353
|
className: "text-sm font-medium text-text-secondary mb-1",
|
|
349
|
-
children:
|
|
354
|
+
children: T("auth.userDetails.lastUpdated", "Last Updated")
|
|
350
355
|
}), /* @__PURE__ */ p("dd", {
|
|
351
356
|
className: "text-text-primary font-medium",
|
|
352
|
-
children: new Date(
|
|
357
|
+
children: new Date(P.updatedAt).toLocaleString()
|
|
353
358
|
})]
|
|
354
359
|
})
|
|
355
360
|
]
|
|
356
361
|
}),
|
|
357
362
|
/* @__PURE__ */ m("div", {
|
|
358
363
|
className: "mt-8 pt-6 border-t border-border-subtle flex gap-3",
|
|
359
|
-
children: [
|
|
364
|
+
children: [P.status !== "DELETED" && k && /* @__PURE__ */ p("button", {
|
|
360
365
|
type: "button",
|
|
361
|
-
onClick: () =>
|
|
366
|
+
onClick: () => U("deactivate"),
|
|
362
367
|
className: "px-4 py-2.5 rounded-xl border border-status-error-border text-status-error-text font-medium hover:bg-status-error-bg-subtle transition-colors",
|
|
363
|
-
children:
|
|
364
|
-
}),
|
|
368
|
+
children: T("auth.userDetails.deactivateUser", "Deactivate User")
|
|
369
|
+
}), k && P.status === "DELETED" && D?.role === "SUPER_ADMIN" && /* @__PURE__ */ p("button", {
|
|
365
370
|
type: "button",
|
|
366
|
-
onClick: () =>
|
|
371
|
+
onClick: () => U("hard-delete"),
|
|
367
372
|
className: "px-4 py-2.5 rounded-xl bg-status-error-bg text-white font-medium hover:bg-status-error-bg-hover transition-colors",
|
|
368
|
-
children:
|
|
373
|
+
children: T("auth.userDetails.permanentlyDelete", "Permanently Delete")
|
|
369
374
|
})]
|
|
370
375
|
}),
|
|
371
|
-
/* @__PURE__ */ p(
|
|
376
|
+
/* @__PURE__ */ p(v, {
|
|
372
377
|
className: "mt-8",
|
|
373
378
|
storageKey: "auth-user-details",
|
|
374
379
|
steps: [{
|
|
375
380
|
id: "back-to-users",
|
|
376
|
-
label:
|
|
377
|
-
description:
|
|
378
|
-
onClick: () =>
|
|
381
|
+
label: T("auth.userDetails.nextBack", "Return to the user list"),
|
|
382
|
+
description: T("auth.userDetails.nextBackDesc", "Browse or search everyone in your organization."),
|
|
383
|
+
onClick: () => C("/auth/users")
|
|
379
384
|
}, {
|
|
380
385
|
id: "export-user",
|
|
381
|
-
label:
|
|
382
|
-
description:
|
|
383
|
-
onClick: () => void
|
|
386
|
+
label: T("auth.userDetails.nextExport", "Export this user's data"),
|
|
387
|
+
description: T("auth.userDetails.nextExportDesc", "Download their profile, sessions, and audit history as CSV."),
|
|
388
|
+
onClick: () => void Q()
|
|
384
389
|
}]
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ p(a, {
|
|
392
|
+
open: J,
|
|
393
|
+
onOpenChange: Y,
|
|
394
|
+
title: T("auth.userDetails.exportQuotaTitle", "Export Limit Reached"),
|
|
395
|
+
description: T("auth.userDetails.exportQuotaDescription", "You have reached your export limit for this month."),
|
|
396
|
+
confirmText: T("auth.userDetails.exportQuotaViewBilling", "View Billing"),
|
|
397
|
+
cancelText: T("auth.userDetails.exportQuotaDismiss", "Dismiss"),
|
|
398
|
+
variant: "warning",
|
|
399
|
+
onConfirm: () => window.location.assign("/billing")
|
|
385
400
|
})
|
|
386
401
|
]
|
|
387
402
|
})
|
|
388
403
|
]
|
|
389
404
|
}) : /* @__PURE__ */ p("div", {
|
|
390
405
|
className: "max-w-4xl mx-auto p-6",
|
|
391
|
-
children: /* @__PURE__ */ p(
|
|
406
|
+
children: /* @__PURE__ */ p(_, {
|
|
392
407
|
illustration: "empty-generic",
|
|
393
|
-
title:
|
|
394
|
-
description:
|
|
408
|
+
title: T("auth.userDetails.adminRequired", "Admin Access Required"),
|
|
409
|
+
description: T("auth.userDetails.adminRequiredDesc", "You need administrator privileges to view user details.")
|
|
395
410
|
})
|
|
396
411
|
}) : /* @__PURE__ */ p("div", {
|
|
397
412
|
className: "max-w-4xl mx-auto p-6",
|
|
398
|
-
children: /* @__PURE__ */ p(
|
|
413
|
+
children: /* @__PURE__ */ p(_, {
|
|
399
414
|
illustration: "empty-generic",
|
|
400
|
-
title:
|
|
401
|
-
description:
|
|
415
|
+
title: T("auth.userDetails.authRequired", "Authentication Required"),
|
|
416
|
+
description: T("auth.userDetails.signInToView", "Please sign in to view user details")
|
|
402
417
|
})
|
|
403
418
|
});
|
|
404
419
|
}
|
|
405
420
|
//#endregion
|
|
406
|
-
export {
|
|
421
|
+
export { S as UserDetailsPage };
|
|
407
422
|
|
|
408
423
|
//# sourceMappingURL=UserDetailsPage.js.map
|