@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.
@@ -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 { useCreateAuthExportJobMutation as a } from "../../generated/wspace-operations.js";
6
- import { ConfirmActionDialog as o } from "../components/ConfirmActionDialog.js";
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 { EmphasisPanel as h, IllustratedEmptyState as g, NextSteps as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
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 y = (e) => {
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
- }, b = (e) => {
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 x() {
33
- let { id: x } = u(), S = l(), { t: C } = d(), w = (e, t) => {
34
- let n = C(e);
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
- }, T = e((e) => e.isAuthenticated), E = e((e) => e.user), { canViewUsers: D, canDeleteUsers: O, isLoading: k } = i(), { getUser: A, deleteUser: j, hardDeleteUser: M } = r(), [N, P] = c(null), [F, I] = c(!0), [L, R] = c(null), [z, B] = c(null), [V, H] = c(null), [U, { loading: W }] = a(), [G, K] = c(null);
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 (!x) {
40
- R("Missing user id"), I(!1);
40
+ if (!S) {
41
+ z("Missing user id"), L(!1);
41
42
  return;
42
43
  }
43
- if (!T) {
44
- I(!1);
44
+ if (!E) {
45
+ L(!1);
45
46
  return;
46
47
  }
47
- return I(!0), R(null), A(x).then((t) => {
48
- e || (t ? P(t) : R(w("auth.userDetails.userNotFound", "User not found")));
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 || R(t instanceof Error ? t.message : "Failed to fetch user details");
51
+ e || z(t instanceof Error ? t.message : "Failed to fetch user details");
51
52
  }).finally(() => {
52
- e || I(!1);
53
+ e || L(!1);
53
54
  }), () => {
54
55
  e = !0;
55
56
  };
56
57
  }, [
57
- x,
58
- A,
59
- T
58
+ S,
59
+ j,
60
+ E
60
61
  ]);
61
- let q = async () => {
62
- if (N) try {
63
- let e = await j(N.id);
62
+ let X = async () => {
63
+ if (P) try {
64
+ let e = await M(P.id);
64
65
  if (e.success) {
65
- B(w("auth.userDetails.userDeactivated", "User \"{email}\" has been deactivated.").replace("{email}", N.email)), H(null);
66
- let e = await A(N.id);
67
- e && P(e);
68
- } else R(e.message);
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
- R(e instanceof Error ? e.message : "Failed to delete user");
71
+ z(e instanceof Error ? e.message : "Failed to delete user");
71
72
  }
72
- }, J = async () => {
73
- if (N) try {
74
- let e = await M(N.id);
75
- e.success ? (H(null), S("/auth/users")) : R(e.message);
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
- R(e instanceof Error ? e.message : "Failed to hard delete user");
78
+ z(e instanceof Error ? e.message : "Failed to hard delete user");
78
79
  }
79
- }, Y = async () => {
80
- if (N) {
81
- K(null);
80
+ }, Q = async () => {
81
+ if (P) {
82
+ q(null);
82
83
  try {
83
- await U({ variables: { input: {
84
- name: `User Data Export - ${N.email}`,
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
- K(e instanceof Error ? e.message : "Failed to start export");
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 T ? k || F ? /* @__PURE__ */ p("div", {
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: w("auth.userDetails.loading", "Loading user...")
115
+ children: T("auth.userDetails.loading", "Loading user...")
111
116
  })]
112
117
  })
113
- }) : D ? L || !N ? /* @__PURE__ */ m("div", {
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: () => S("/auth/users"),
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
- }), w("auth.userDetails.backToUsers", "Back to Users")]
136
+ }), T("auth.userDetails.backToUsers", "Back to Users")]
132
137
  }), /* @__PURE__ */ p("div", {
133
138
  role: "alert",
134
- children: /* @__PURE__ */ p(g, {
139
+ children: /* @__PURE__ */ p(_, {
135
140
  illustration: "empty-search",
136
- title: w("auth.userDetails.userNotFound", "User not found"),
137
- description: L ?? w("auth.userDetails.userNotFoundDesc", "We couldn't find this user. They may have been removed, or the link is out of date.")
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(o, {
144
- open: V !== null,
148
+ /* @__PURE__ */ p(a, {
149
+ open: H !== null,
145
150
  onOpenChange: (e) => {
146
- e || H(null);
151
+ e || U(null);
147
152
  },
148
- title: V === "hard-delete" ? w("auth.userDetails.hardDeleteTitle", "Permanently delete user?") : w("auth.userDetails.deactivateTitle", "Deactivate user?"),
149
- description: V === "hard-delete" ? w("auth.userDetails.hardDeleteDesc", "This permanently deletes \"{email}\" and cannot be undone.").replace("{email}", N.email) : w("auth.userDetails.deactivateDesc", "\"{email}\" will be prevented from signing in until reactivated.").replace("{email}", N.email),
150
- confirmText: V === "hard-delete" ? w("auth.userDetails.hardDeleteConfirm", "Delete permanently") : w("auth.userDetails.deactivateConfirm", "Deactivate user"),
151
- variant: V === "hard-delete" ? "danger" : "warning",
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
- V === "hard-delete" ? await J() : V === "deactivate" && await q();
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: () => S("/auth/users"),
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
- }), w("auth.userDetails.backToUsers", "Back to Users")]
179
+ }), T("auth.userDetails.backToUsers", "Back to Users")]
175
180
  }), /* @__PURE__ */ p("button", {
176
181
  type: "button",
177
- onClick: () => void Y(),
178
- disabled: W,
179
- "aria-label": w("auth.userDetails.exportAriaLabel", "Export user data"),
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: W ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(n, {
186
+ children: G ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(n, {
182
187
  className: "size-4 animate-spin",
183
188
  "aria-hidden": "true"
184
- }), w("auth.userDetails.exporting", "Exporting...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("svg", {
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
- }), w("auth.userDetails.exportButton", "Export User Data")] })
201
+ }), T("auth.userDetails.exportButton", "Export User Data")] })
197
202
  })]
198
203
  }),
199
- /* @__PURE__ */ p(v, {
204
+ /* @__PURE__ */ p(y, {
200
205
  className: "mb-6",
201
- children: w("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.")
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
- G && /* @__PURE__ */ m("div", {
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: G
216
+ children: K
212
217
  })]
213
218
  }),
214
- z && /* @__PURE__ */ m("div", {
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: z
223
+ children: B
219
224
  }), /* @__PURE__ */ p("button", {
220
225
  type: "button",
221
- onClick: () => B(null),
226
+ onClick: () => V(null),
222
227
  className: "mt-2 text-sm text-status-success-text hover:underline",
223
- children: w("auth.userDetails.dismiss", "Dismiss")
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(h, {
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: (N.name || N.username || N.email).charAt(0).toUpperCase()
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: N.name || N.username
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: N.email
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 ${y(N.role)}`,
251
- children: N.role.replace("_", " ")
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 ${b(N.status)}`,
254
- children: N.status
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: w("auth.userDetails.username", "Username")
272
+ children: T("auth.userDetails.username", "Username")
268
273
  }), /* @__PURE__ */ p("dd", {
269
274
  className: "text-text-primary font-medium",
270
- children: N.username
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: w("auth.userDetails.email", "Email")
282
+ children: T("auth.userDetails.email", "Email")
278
283
  }), /* @__PURE__ */ p("dd", {
279
284
  className: "text-text-primary font-medium",
280
- children: N.email
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: w("auth.userDetails.emailVerified", "Email Verified")
292
+ children: T("auth.userDetails.emailVerified", "Email Verified")
288
293
  }), /* @__PURE__ */ p("dd", {
289
294
  className: "text-text-primary font-medium",
290
- children: N.emailVerified ? /* @__PURE__ */ p("span", {
295
+ children: P.emailVerified ? /* @__PURE__ */ p("span", {
291
296
  className: "text-status-success-text",
292
- children: w("auth.userDetails.yes", "Yes")
297
+ children: T("auth.userDetails.yes", "Yes")
293
298
  }) : /* @__PURE__ */ p("span", {
294
299
  className: "text-status-warning-text",
295
- children: w("auth.userDetails.no", "No")
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: w("auth.userDetails.mfaEnabled", "MFA Enabled")
308
+ children: T("auth.userDetails.mfaEnabled", "MFA Enabled")
304
309
  }), /* @__PURE__ */ p("dd", {
305
310
  className: "text-text-primary font-medium",
306
- children: N.mfaEnabled ? /* @__PURE__ */ p("span", {
311
+ children: P.mfaEnabled ? /* @__PURE__ */ p("span", {
307
312
  className: "text-status-success-text",
308
- children: w("auth.userDetails.yes", "Yes")
313
+ children: T("auth.userDetails.yes", "Yes")
309
314
  }) : /* @__PURE__ */ p("span", {
310
315
  className: "text-text-secondary",
311
- children: w("auth.userDetails.no", "No")
316
+ children: T("auth.userDetails.no", "No")
312
317
  })
313
318
  })]
314
319
  }),
315
- N.phoneNumber && /* @__PURE__ */ m("div", {
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: w("auth.userDetails.phoneNumber", "Phone Number")
324
+ children: T("auth.userDetails.phoneNumber", "Phone Number")
320
325
  }), /* @__PURE__ */ p("dd", {
321
326
  className: "text-text-primary font-medium",
322
- children: N.phoneNumber
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: w("auth.userDetails.lastLogin", "Last Login")
334
+ children: T("auth.userDetails.lastLogin", "Last Login")
330
335
  }), /* @__PURE__ */ p("dd", {
331
336
  className: "text-text-primary font-medium",
332
- children: N.lastLoginAt ? new Date(N.lastLoginAt).toLocaleString() : w("auth.userDetails.never", "Never")
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: w("auth.userDetails.created", "Created")
344
+ children: T("auth.userDetails.created", "Created")
340
345
  }), /* @__PURE__ */ p("dd", {
341
346
  className: "text-text-primary font-medium",
342
- children: new Date(N.createdAt).toLocaleString()
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: w("auth.userDetails.lastUpdated", "Last Updated")
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(N.updatedAt).toLocaleString()
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: [N.status !== "DELETED" && O && /* @__PURE__ */ p("button", {
364
+ children: [P.status !== "DELETED" && k && /* @__PURE__ */ p("button", {
360
365
  type: "button",
361
- onClick: () => H("deactivate"),
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: w("auth.userDetails.deactivateUser", "Deactivate User")
364
- }), O && N.status === "DELETED" && E?.role === "SUPER_ADMIN" && /* @__PURE__ */ p("button", {
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: () => H("hard-delete"),
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: w("auth.userDetails.permanentlyDelete", "Permanently Delete")
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: w("auth.userDetails.nextBack", "Return to the user list"),
377
- description: w("auth.userDetails.nextBackDesc", "Browse or search everyone in your organization."),
378
- onClick: () => S("/auth/users")
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: w("auth.userDetails.nextExport", "Export this user's data"),
382
- description: w("auth.userDetails.nextExportDesc", "Download their profile, sessions, and audit history as CSV."),
383
- onClick: () => void Y()
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(g, {
406
+ children: /* @__PURE__ */ p(_, {
392
407
  illustration: "empty-generic",
393
- title: w("auth.userDetails.adminRequired", "Admin Access Required"),
394
- description: w("auth.userDetails.adminRequiredDesc", "You need administrator privileges to view user details.")
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(g, {
413
+ children: /* @__PURE__ */ p(_, {
399
414
  illustration: "empty-generic",
400
- title: w("auth.userDetails.authRequired", "Authentication Required"),
401
- description: w("auth.userDetails.signInToView", "Please sign in to view user details")
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 { x as UserDetailsPage };
421
+ export { S as UserDetailsPage };
407
422
 
408
423
  //# sourceMappingURL=UserDetailsPage.js.map