@burdenoff/microfe-auth 2026.510.127
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/README.md +12 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/auth/AuthRoot.d.ts +30 -0
- package/dist/auth/AuthRoot.d.ts.map +1 -0
- package/dist/auth/AuthRoot.js +82 -0
- package/dist/auth/AuthRoot.js.map +1 -0
- package/dist/auth/AuthRoutes.d.ts +29 -0
- package/dist/auth/AuthRoutes.d.ts.map +1 -0
- package/dist/auth/AuthRoutes.js +271 -0
- package/dist/auth/AuthRoutes.js.map +1 -0
- package/dist/auth/components/AuthIcons.d.ts +17 -0
- package/dist/auth/components/AuthIcons.d.ts.map +1 -0
- package/dist/auth/components/AuthIcons.js +197 -0
- package/dist/auth/components/AuthIcons.js.map +1 -0
- package/dist/auth/components/AuthLayout.d.ts +17 -0
- package/dist/auth/components/AuthLayout.d.ts.map +1 -0
- package/dist/auth/components/AuthLayout.js +237 -0
- package/dist/auth/components/AuthLayout.js.map +1 -0
- package/dist/auth/components/CaptchaV2.d.ts +16 -0
- package/dist/auth/components/CaptchaV2.d.ts.map +1 -0
- package/dist/auth/components/CaptchaV2.js +47 -0
- package/dist/auth/components/CaptchaV2.js.map +1 -0
- package/dist/auth/components/ConfirmActionDialog.d.ts +16 -0
- package/dist/auth/components/ConfirmActionDialog.d.ts.map +1 -0
- package/dist/auth/components/ConfirmActionDialog.js +68 -0
- package/dist/auth/components/ConfirmActionDialog.js.map +1 -0
- package/dist/auth/components/index.d.ts +4 -0
- package/dist/auth/components/index.d.ts.map +1 -0
- package/dist/auth/components/profile/UserProfileMenu.d.ts +42 -0
- package/dist/auth/components/profile/UserProfileMenu.d.ts.map +1 -0
- package/dist/auth/components/profile/UserProfileMenu.js +91 -0
- package/dist/auth/components/profile/UserProfileMenu.js.map +1 -0
- package/dist/auth/components/workspace/WorkspaceSelector.d.ts +76 -0
- package/dist/auth/components/workspace/WorkspaceSelector.d.ts.map +1 -0
- package/dist/auth/components/workspace/WorkspaceSelector.js +240 -0
- package/dist/auth/components/workspace/WorkspaceSelector.js.map +1 -0
- package/dist/auth/constants/permissions.d.ts +30 -0
- package/dist/auth/constants/permissions.d.ts.map +1 -0
- package/dist/auth/constants/permissions.js +18 -0
- package/dist/auth/constants/permissions.js.map +1 -0
- package/dist/auth/constants/sessionKeys.d.ts +18 -0
- package/dist/auth/constants/sessionKeys.d.ts.map +1 -0
- package/dist/auth/constants/sessionKeys.js +6 -0
- package/dist/auth/constants/sessionKeys.js.map +1 -0
- package/dist/auth/hooks/index.d.ts +18 -0
- package/dist/auth/hooks/index.d.ts.map +1 -0
- package/dist/auth/hooks/index.js +16 -0
- package/dist/auth/hooks/useAccountOperations.d.ts +19 -0
- package/dist/auth/hooks/useAccountOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useAccountOperations.js +52 -0
- package/dist/auth/hooks/useAccountOperations.js.map +1 -0
- package/dist/auth/hooks/useApiKeyOperations.d.ts +22 -0
- package/dist/auth/hooks/useApiKeyOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useApiKeyOperations.js +4 -0
- package/dist/auth/hooks/useAppOperations.d.ts +26 -0
- package/dist/auth/hooks/useAppOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useAppOperations.js +4 -0
- package/dist/auth/hooks/useAuthOperations.d.ts +57 -0
- package/dist/auth/hooks/useAuthOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useAuthOperations.js +236 -0
- package/dist/auth/hooks/useAuthOperations.js.map +1 -0
- package/dist/auth/hooks/useAuthPermissions.d.ts +20 -0
- package/dist/auth/hooks/useAuthPermissions.d.ts.map +1 -0
- package/dist/auth/hooks/useAuthPermissions.js +22 -0
- package/dist/auth/hooks/useAuthPermissions.js.map +1 -0
- package/dist/auth/hooks/useCaptchaV3.d.ts +13 -0
- package/dist/auth/hooks/useCaptchaV3.d.ts.map +1 -0
- package/dist/auth/hooks/useCaptchaV3.js +19 -0
- package/dist/auth/hooks/useCaptchaV3.js.map +1 -0
- package/dist/auth/hooks/useContextSwitcherData.d.ts +106 -0
- package/dist/auth/hooks/useContextSwitcherData.d.ts.map +1 -0
- package/dist/auth/hooks/useContextSwitcherData.js +466 -0
- package/dist/auth/hooks/useContextSwitcherData.js.map +1 -0
- package/dist/auth/hooks/useDelegationOperations.d.ts +25 -0
- package/dist/auth/hooks/useDelegationOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useDelegationOperations.js +4 -0
- package/dist/auth/hooks/useMfaOperations.d.ts +18 -0
- package/dist/auth/hooks/useMfaOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useMfaOperations.js +103 -0
- package/dist/auth/hooks/useMfaOperations.js.map +1 -0
- package/dist/auth/hooks/useMyWorkspaces.d.ts +45 -0
- package/dist/auth/hooks/useMyWorkspaces.d.ts.map +1 -0
- package/dist/auth/hooks/useMyWorkspaces.js +140 -0
- package/dist/auth/hooks/useMyWorkspaces.js.map +1 -0
- package/dist/auth/hooks/useOAuthOperations.d.ts +19 -0
- package/dist/auth/hooks/useOAuthOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useOAuthOperations.js +103 -0
- package/dist/auth/hooks/useOAuthOperations.js.map +1 -0
- package/dist/auth/hooks/usePasswordOperations.d.ts +13 -0
- package/dist/auth/hooks/usePasswordOperations.d.ts.map +1 -0
- package/dist/auth/hooks/usePasswordOperations.js +56 -0
- package/dist/auth/hooks/usePasswordOperations.js.map +1 -0
- package/dist/auth/hooks/useSessionOperations.d.ts +41 -0
- package/dist/auth/hooks/useSessionOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useSessionOperations.js +59 -0
- package/dist/auth/hooks/useSessionOperations.js.map +1 -0
- package/dist/auth/hooks/useSsoOperations.d.ts +65 -0
- package/dist/auth/hooks/useSsoOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useSsoOperations.js +236 -0
- package/dist/auth/hooks/useSsoOperations.js.map +1 -0
- package/dist/auth/hooks/useTokenRefresh.d.ts +56 -0
- package/dist/auth/hooks/useTokenRefresh.d.ts.map +1 -0
- package/dist/auth/hooks/useTokenRefresh.js +53 -0
- package/dist/auth/hooks/useTokenRefresh.js.map +1 -0
- package/dist/auth/hooks/useUserOperations.d.ts +32 -0
- package/dist/auth/hooks/useUserOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useUserOperations.js +100 -0
- package/dist/auth/hooks/useUserOperations.js.map +1 -0
- package/dist/auth/hooks/useWorkspaceOperations.d.ts +35 -0
- package/dist/auth/hooks/useWorkspaceOperations.d.ts.map +1 -0
- package/dist/auth/hooks/useWorkspaceOperations.js +35 -0
- package/dist/auth/hooks/useWorkspaceOperations.js.map +1 -0
- package/dist/auth/hooks/useWorkspaceToken.d.ts +56 -0
- package/dist/auth/hooks/useWorkspaceToken.d.ts.map +1 -0
- package/dist/auth/hooks/useWorkspaceToken.js +94 -0
- package/dist/auth/hooks/useWorkspaceToken.js.map +1 -0
- package/dist/auth/index.d.ts +63 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +18 -0
- package/dist/auth/pages/ApiKeysPage.d.ts +5 -0
- package/dist/auth/pages/ApiKeysPage.d.ts.map +1 -0
- package/dist/auth/pages/AppsPage.d.ts +5 -0
- package/dist/auth/pages/AppsPage.d.ts.map +1 -0
- package/dist/auth/pages/AuditLogPage.d.ts +5 -0
- package/dist/auth/pages/AuditLogPage.d.ts.map +1 -0
- package/dist/auth/pages/AuditLogPage.js +129 -0
- package/dist/auth/pages/AuditLogPage.js.map +1 -0
- package/dist/auth/pages/DelegationsPage.d.ts +5 -0
- package/dist/auth/pages/DelegationsPage.d.ts.map +1 -0
- package/dist/auth/pages/EmailVerifyPage.d.ts +5 -0
- package/dist/auth/pages/EmailVerifyPage.d.ts.map +1 -0
- package/dist/auth/pages/EmailVerifyPage.js +166 -0
- package/dist/auth/pages/EmailVerifyPage.js.map +1 -0
- package/dist/auth/pages/LoginPage.d.ts +6 -0
- package/dist/auth/pages/LoginPage.d.ts.map +1 -0
- package/dist/auth/pages/LoginPage.js +575 -0
- package/dist/auth/pages/LoginPage.js.map +1 -0
- package/dist/auth/pages/MagicLinkPage.d.ts +6 -0
- package/dist/auth/pages/MagicLinkPage.d.ts.map +1 -0
- package/dist/auth/pages/MagicLinkPage.js +219 -0
- package/dist/auth/pages/MagicLinkPage.js.map +1 -0
- package/dist/auth/pages/MfaSetupPage.d.ts +5 -0
- package/dist/auth/pages/MfaSetupPage.d.ts.map +1 -0
- package/dist/auth/pages/MfaSetupPage.js +341 -0
- package/dist/auth/pages/MfaSetupPage.js.map +1 -0
- package/dist/auth/pages/MfaVerifyPage.d.ts +7 -0
- package/dist/auth/pages/MfaVerifyPage.d.ts.map +1 -0
- package/dist/auth/pages/MfaVerifyPage.js +189 -0
- package/dist/auth/pages/MfaVerifyPage.js.map +1 -0
- package/dist/auth/pages/OAuthCallbackPage.d.ts +7 -0
- package/dist/auth/pages/OAuthCallbackPage.d.ts.map +1 -0
- package/dist/auth/pages/OAuthCallbackPage.js +100 -0
- package/dist/auth/pages/OAuthCallbackPage.js.map +1 -0
- package/dist/auth/pages/PasswordResetPage.d.ts +6 -0
- package/dist/auth/pages/PasswordResetPage.d.ts.map +1 -0
- package/dist/auth/pages/PasswordResetPage.js +352 -0
- package/dist/auth/pages/PasswordResetPage.js.map +1 -0
- package/dist/auth/pages/ReactivatePage.d.ts +6 -0
- package/dist/auth/pages/ReactivatePage.d.ts.map +1 -0
- package/dist/auth/pages/ReactivatePage.js +217 -0
- package/dist/auth/pages/ReactivatePage.js.map +1 -0
- package/dist/auth/pages/RegisterPage.d.ts +5 -0
- package/dist/auth/pages/RegisterPage.d.ts.map +1 -0
- package/dist/auth/pages/RegisterPage.js +439 -0
- package/dist/auth/pages/RegisterPage.js.map +1 -0
- package/dist/auth/pages/SSORelayCallbackPage.d.ts +8 -0
- package/dist/auth/pages/SSORelayCallbackPage.d.ts.map +1 -0
- package/dist/auth/pages/SSORelayCallbackPage.js +48 -0
- package/dist/auth/pages/SSORelayCallbackPage.js.map +1 -0
- package/dist/auth/pages/SSORelayPage.d.ts +18 -0
- package/dist/auth/pages/SSORelayPage.d.ts.map +1 -0
- package/dist/auth/pages/SSORelayPage.js +134 -0
- package/dist/auth/pages/SSORelayPage.js.map +1 -0
- package/dist/auth/pages/SecurityPage.d.ts +5 -0
- package/dist/auth/pages/SecurityPage.d.ts.map +1 -0
- package/dist/auth/pages/SecurityPage.js +587 -0
- package/dist/auth/pages/SecurityPage.js.map +1 -0
- package/dist/auth/pages/SessionBridgePage.d.ts +14 -0
- package/dist/auth/pages/SessionBridgePage.d.ts.map +1 -0
- package/dist/auth/pages/SessionBridgePage.js +231 -0
- package/dist/auth/pages/SessionBridgePage.js.map +1 -0
- package/dist/auth/pages/SessionsPage.d.ts +5 -0
- package/dist/auth/pages/SessionsPage.d.ts.map +1 -0
- package/dist/auth/pages/SessionsPage.js +258 -0
- package/dist/auth/pages/SessionsPage.js.map +1 -0
- package/dist/auth/pages/SsoCallbackPage.d.ts +8 -0
- package/dist/auth/pages/SsoCallbackPage.d.ts.map +1 -0
- package/dist/auth/pages/SsoCallbackPage.js +188 -0
- package/dist/auth/pages/SsoCallbackPage.js.map +1 -0
- package/dist/auth/pages/SsoConfigPage.d.ts +6 -0
- package/dist/auth/pages/SsoConfigPage.d.ts.map +1 -0
- package/dist/auth/pages/SsoConfigPage.js +1144 -0
- package/dist/auth/pages/SsoConfigPage.js.map +1 -0
- package/dist/auth/pages/SsoLoginPage.d.ts +7 -0
- package/dist/auth/pages/SsoLoginPage.d.ts.map +1 -0
- package/dist/auth/pages/SsoLoginPage.js +236 -0
- package/dist/auth/pages/SsoLoginPage.js.map +1 -0
- package/dist/auth/pages/UserDetailsPage.d.ts +11 -0
- package/dist/auth/pages/UserDetailsPage.d.ts.map +1 -0
- package/dist/auth/pages/UserDetailsPage.js +338 -0
- package/dist/auth/pages/UserDetailsPage.js.map +1 -0
- package/dist/auth/pages/UserProfilePage.d.ts +5 -0
- package/dist/auth/pages/UserProfilePage.d.ts.map +1 -0
- package/dist/auth/pages/UserProfilePage.js +445 -0
- package/dist/auth/pages/UserProfilePage.js.map +1 -0
- package/dist/auth/pages/UsersPage.d.ts +5 -0
- package/dist/auth/pages/UsersPage.d.ts.map +1 -0
- package/dist/auth/pages/UsersPage.js +899 -0
- package/dist/auth/pages/UsersPage.js.map +1 -0
- package/dist/auth/providers/AuthProvider.d.ts +18 -0
- package/dist/auth/providers/AuthProvider.d.ts.map +1 -0
- package/dist/auth/providers/AuthProvider.js +36 -0
- package/dist/auth/providers/AuthProvider.js.map +1 -0
- package/dist/auth/providers/CaptchaProvider.d.ts +13 -0
- package/dist/auth/providers/CaptchaProvider.d.ts.map +1 -0
- package/dist/auth/providers/CaptchaProvider.js +21 -0
- package/dist/auth/providers/CaptchaProvider.js.map +1 -0
- package/dist/auth/store/authStore.d.ts +91 -0
- package/dist/auth/store/authStore.d.ts.map +1 -0
- package/dist/auth/store/authStore.js +314 -0
- package/dist/auth/store/authStore.js.map +1 -0
- package/dist/auth/types/index.d.ts +636 -0
- package/dist/auth/types/index.d.ts.map +1 -0
- package/dist/auth/utils/captchaConfig.d.ts +4 -0
- package/dist/auth/utils/captchaConfig.d.ts.map +1 -0
- package/dist/auth/utils/captchaConfig.js +13 -0
- package/dist/auth/utils/captchaConfig.js.map +1 -0
- package/dist/auth/utils/formatters.d.ts +37 -0
- package/dist/auth/utils/formatters.d.ts.map +1 -0
- package/dist/auth/utils/formatters.js +48 -0
- package/dist/auth/utils/formatters.js.map +1 -0
- package/dist/auth/utils/gatewayBaseUrls.d.ts +6 -0
- package/dist/auth/utils/gatewayBaseUrls.d.ts.map +1 -0
- package/dist/auth/utils/gatewayBaseUrls.js +18 -0
- package/dist/auth/utils/gatewayBaseUrls.js.map +1 -0
- package/dist/auth/utils/index.d.ts +3 -0
- package/dist/auth/utils/index.d.ts.map +1 -0
- package/dist/auth/utils/validation.d.ts +30 -0
- package/dist/auth/utils/validation.d.ts.map +1 -0
- package/dist/auth/utils/validation.js +15 -0
- package/dist/auth/utils/validation.js.map +1 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2978 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-operations.js +944 -0
- package/dist/generated/global-operations.js.map +1 -0
- package/dist/generated/global-types.d.ts +21253 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +55214 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/microfe-auth.css +3 -0
- package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +70 -0
- package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -0
- package/dist/node_modules/object-assign/index.js +41 -0
- package/dist/node_modules/object-assign/index.js.map +1 -0
- package/dist/node_modules/prop-types/checkPropTypes.js +46 -0
- package/dist/node_modules/prop-types/checkPropTypes.js.map +1 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +49 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js.map +1 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +272 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -0
- package/dist/node_modules/prop-types/index.js +16 -0
- package/dist/node_modules/prop-types/index.js.map +1 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +1 -0
- package/dist/node_modules/prop-types/lib/has.js +10 -0
- package/dist/node_modules/prop-types/lib/has.js.map +1 -0
- package/dist/node_modules/qrcode.react/lib/esm/index.js +959 -0
- package/dist/node_modules/qrcode.react/lib/esm/index.js.map +1 -0
- package/dist/node_modules/react-async-script/lib/esm/async-script-loader.js +114 -0
- package/dist/node_modules/react-async-script/lib/esm/async-script-loader.js.map +1 -0
- package/dist/node_modules/react-google-recaptcha/lib/esm/index.js +8 -0
- package/dist/node_modules/react-google-recaptcha/lib/esm/index.js.map +1 -0
- package/dist/node_modules/react-google-recaptcha/lib/esm/recaptcha-wrapper.js +20 -0
- package/dist/node_modules/react-google-recaptcha/lib/esm/recaptcha-wrapper.js.map +1 -0
- package/dist/node_modules/react-google-recaptcha/lib/esm/recaptcha.js +148 -0
- package/dist/node_modules/react-google-recaptcha/lib/esm/recaptcha.js.map +1 -0
- package/dist/node_modules/react-google-recaptcha-v3/dist/react-google-recaptcha-v3.esm.js +445 -0
- package/dist/node_modules/react-google-recaptcha-v3/dist/react-google-recaptcha-v3.esm.js.map +1 -0
- package/dist/node_modules/react-is/cjs/react-is.development.js +84 -0
- package/dist/node_modules/react-is/cjs/react-is.development.js.map +1 -0
- package/dist/node_modules/react-is/cjs/react-is.production.min.js +64 -0
- package/dist/node_modules/react-is/cjs/react-is.production.min.js.map +1 -0
- package/dist/node_modules/react-is/index.js +12 -0
- package/dist/node_modules/react-is/index.js.map +1 -0
- package/dist/shared/hooks/index.d.ts +7 -0
- package/dist/shared/hooks/index.d.ts.map +1 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/types/index.d.ts +109 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +114 -0
|
@@ -0,0 +1,899 @@
|
|
|
1
|
+
import { useAuthStore as e } from "../store/authStore.js";
|
|
2
|
+
import { useUserOperations as t } from "../hooks/useUserOperations.js";
|
|
3
|
+
import { useAuthPermissions as n } from "../hooks/useAuthPermissions.js";
|
|
4
|
+
import "../hooks/index.js";
|
|
5
|
+
import { AlertIcon as r, SpinnerIcon as i } from "../components/AuthIcons.js";
|
|
6
|
+
import { ConfirmActionDialog as a } from "../components/ConfirmActionDialog.js";
|
|
7
|
+
import { nativeImpact as ee, nativeNotify as o } from "../../utils/nativeBridge.js";
|
|
8
|
+
import { useCallback as te, useEffect as ne, useState as s } from "react";
|
|
9
|
+
import { useNavigate as re } from "react-router-dom";
|
|
10
|
+
import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
11
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
12
|
+
//#region src/auth/pages/UsersPage.tsx
|
|
13
|
+
var f = [
|
|
14
|
+
"SUPER_ADMIN",
|
|
15
|
+
"TENANT_ADMIN",
|
|
16
|
+
"ORG_ADMIN",
|
|
17
|
+
"WORKSPACE_ADMIN",
|
|
18
|
+
"MEMBER",
|
|
19
|
+
"GUEST"
|
|
20
|
+
], p = [
|
|
21
|
+
"ACTIVE",
|
|
22
|
+
"INACTIVE",
|
|
23
|
+
"SUSPENDED",
|
|
24
|
+
"DELETED"
|
|
25
|
+
];
|
|
26
|
+
function m() {
|
|
27
|
+
let m = re(), { t: ie } = c(), ae = (e, t) => {
|
|
28
|
+
let n = ie(e);
|
|
29
|
+
return n === e ? t : n;
|
|
30
|
+
}, h = e((e) => e.isAuthenticated), g = e((e) => e.user), { canViewUsers: _, canUpdateUsers: oe, canDeleteUsers: v, isLoading: se } = n(), { listUsers: y, updateUser: b, deleteUser: ce, hardDeleteUser: le, isLoading: x } = t(), [S, C] = s([]), [w, T] = s(0), [E, ue] = s(!1), [D, O] = s("list"), [k, A] = s(null), [j, M] = s({
|
|
31
|
+
username: "",
|
|
32
|
+
firstName: "",
|
|
33
|
+
lastName: "",
|
|
34
|
+
name: "",
|
|
35
|
+
phoneNumber: "",
|
|
36
|
+
role: "MEMBER",
|
|
37
|
+
status: "ACTIVE",
|
|
38
|
+
emailVerified: !1
|
|
39
|
+
}), [N, P] = s(null), [F, I] = s(!1), [L, R] = s(null), [z, B] = s(null), [V, H] = s(""), [U, de] = s(""), [W, G] = s(""), [K, q] = s(0), J = te(async () => {
|
|
40
|
+
if (h) try {
|
|
41
|
+
I(!1);
|
|
42
|
+
let e = {};
|
|
43
|
+
V && (e.search = V), U && (e.role = U), W && (e.status = W);
|
|
44
|
+
let t = await y(e, {
|
|
45
|
+
offset: K * 10,
|
|
46
|
+
limit: 10
|
|
47
|
+
});
|
|
48
|
+
C(t.users), T(t.totalCount), ue(t.hasMore), P(null);
|
|
49
|
+
} catch (e) {
|
|
50
|
+
if (e instanceof Error && (e.name === "AbortError" || e.message.includes("aborted"))) return;
|
|
51
|
+
let t = e instanceof Error ? e.message : "Failed to fetch users";
|
|
52
|
+
t.toLowerCase().includes("not authorized") || t.toLowerCase().includes("forbidden") ? (I(!0), P(null)) : P(t);
|
|
53
|
+
}
|
|
54
|
+
}, [
|
|
55
|
+
y,
|
|
56
|
+
V,
|
|
57
|
+
U,
|
|
58
|
+
W,
|
|
59
|
+
K,
|
|
60
|
+
h
|
|
61
|
+
]);
|
|
62
|
+
ne(() => {
|
|
63
|
+
J();
|
|
64
|
+
}, [J]);
|
|
65
|
+
let Y = () => {
|
|
66
|
+
M({
|
|
67
|
+
username: "",
|
|
68
|
+
firstName: "",
|
|
69
|
+
lastName: "",
|
|
70
|
+
name: "",
|
|
71
|
+
phoneNumber: "",
|
|
72
|
+
role: "MEMBER",
|
|
73
|
+
status: "ACTIVE",
|
|
74
|
+
emailVerified: !1
|
|
75
|
+
}), A(null), P(null), R(null);
|
|
76
|
+
}, fe = async (e) => {
|
|
77
|
+
if (e.preventDefault(), k) {
|
|
78
|
+
P(null);
|
|
79
|
+
try {
|
|
80
|
+
await b(k.id, {
|
|
81
|
+
username: j.username || void 0,
|
|
82
|
+
firstName: j.firstName || void 0,
|
|
83
|
+
lastName: j.lastName || void 0,
|
|
84
|
+
name: j.name || void 0,
|
|
85
|
+
phoneNumber: j.phoneNumber || void 0,
|
|
86
|
+
role: j.role,
|
|
87
|
+
status: j.status,
|
|
88
|
+
emailVerified: j.emailVerified
|
|
89
|
+
}), R("User updated successfully!"), O("list"), Y(), J();
|
|
90
|
+
} catch (e) {
|
|
91
|
+
P(e instanceof Error ? e.message : "Failed to update user");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, pe = async (e) => {
|
|
95
|
+
ee("medium");
|
|
96
|
+
try {
|
|
97
|
+
let t = await ce(e.id);
|
|
98
|
+
t.success ? (o("success"), R(`User "${e.email}" has been deactivated.`), B(null), J()) : (o("error"), P(t.message));
|
|
99
|
+
} catch (e) {
|
|
100
|
+
o("error"), P(e instanceof Error ? e.message : "Failed to delete user");
|
|
101
|
+
}
|
|
102
|
+
}, me = async (e) => {
|
|
103
|
+
try {
|
|
104
|
+
let t = await le(e.id);
|
|
105
|
+
t.success ? (R(`User "${e.email}" has been permanently deleted.`), B(null), J()) : P(t.message);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
P(e instanceof Error ? e.message : "Failed to hard delete user");
|
|
108
|
+
}
|
|
109
|
+
}, X = (e) => {
|
|
110
|
+
A(e), M({
|
|
111
|
+
username: e.username || "",
|
|
112
|
+
firstName: e.firstName || "",
|
|
113
|
+
lastName: e.lastName || "",
|
|
114
|
+
name: e.name || "",
|
|
115
|
+
phoneNumber: e.phoneNumber || "",
|
|
116
|
+
role: e.role,
|
|
117
|
+
status: e.status,
|
|
118
|
+
emailVerified: e.emailVerified
|
|
119
|
+
}), O("edit"), P(null);
|
|
120
|
+
}, Z = /* @__PURE__ */ u(a, {
|
|
121
|
+
open: z !== null,
|
|
122
|
+
onOpenChange: (e) => {
|
|
123
|
+
e || B(null);
|
|
124
|
+
},
|
|
125
|
+
title: z?.type === "hard-delete" ? "Permanently delete user?" : "Deactivate user?",
|
|
126
|
+
description: z?.type === "hard-delete" ? z ? `This permanently deletes "${z.user.email}" and cannot be undone.` : "" : z ? `"${z.user.email}" will be prevented from signing in until reactivated.` : "",
|
|
127
|
+
confirmText: z?.type === "hard-delete" ? "Delete permanently" : "Deactivate user",
|
|
128
|
+
variant: z?.type === "hard-delete" ? "danger" : "warning",
|
|
129
|
+
onConfirm: async () => {
|
|
130
|
+
if (z) {
|
|
131
|
+
if (z.type === "hard-delete") {
|
|
132
|
+
await me(z.user);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
await pe(z.user);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}), Q = (e) => {
|
|
139
|
+
switch (e) {
|
|
140
|
+
case "SUPER_ADMIN": return "bg-accent-purple-subtle text-accent-purple";
|
|
141
|
+
case "TENANT_ADMIN": return "bg-status-info-bg-subtle text-status-info-text";
|
|
142
|
+
case "ORG_ADMIN": return "bg-accent-indigo-subtle text-accent-indigo";
|
|
143
|
+
case "WORKSPACE_ADMIN": return "bg-accent-cyan-subtle text-accent-cyan";
|
|
144
|
+
case "MEMBER": return "bg-status-success-bg-subtle text-status-success-text";
|
|
145
|
+
case "GUEST": return "bg-bg-sunken text-text-primary";
|
|
146
|
+
default: return "bg-bg-sunken text-text-primary";
|
|
147
|
+
}
|
|
148
|
+
}, $ = (e) => {
|
|
149
|
+
switch (e) {
|
|
150
|
+
case "ACTIVE": return "bg-status-success-bg-subtle text-status-success-text";
|
|
151
|
+
case "INACTIVE": return "bg-status-warning-bg-subtle text-status-warning-text";
|
|
152
|
+
case "SUSPENDED": return "bg-status-warning-bg-subtle text-status-warning-text";
|
|
153
|
+
case "DELETED": return "bg-status-error-bg-subtle text-status-error-text";
|
|
154
|
+
default: return "bg-bg-sunken text-text-primary";
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
return h ? g && ![
|
|
158
|
+
"SUPER_ADMIN",
|
|
159
|
+
"TENANT_ADMIN",
|
|
160
|
+
"ORG_ADMIN"
|
|
161
|
+
].includes(g.role) ? /* @__PURE__ */ u("div", {
|
|
162
|
+
className: "max-w-6xl mx-auto p-6",
|
|
163
|
+
children: /* @__PURE__ */ d("div", {
|
|
164
|
+
className: "text-center py-16 border-2 border-dashed border-border-subtle rounded-xl",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ u("div", {
|
|
167
|
+
className: "w-16 h-16 mx-auto mb-4 rounded-full bg-status-error-bg-subtle flex items-center justify-center",
|
|
168
|
+
children: /* @__PURE__ */ u("svg", {
|
|
169
|
+
className: "w-8 h-8 text-status-error-text",
|
|
170
|
+
fill: "none",
|
|
171
|
+
viewBox: "0 0 24 24",
|
|
172
|
+
stroke: "currentColor",
|
|
173
|
+
children: /* @__PURE__ */ u("path", {
|
|
174
|
+
strokeLinecap: "round",
|
|
175
|
+
strokeLinejoin: "round",
|
|
176
|
+
strokeWidth: 1.5,
|
|
177
|
+
d: "M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"
|
|
178
|
+
})
|
|
179
|
+
})
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ u("h2", {
|
|
182
|
+
className: "text-xl font-semibold text-text-primary mb-2",
|
|
183
|
+
children: "You are not allowed to access this page"
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ u("p", {
|
|
186
|
+
className: "text-text-secondary",
|
|
187
|
+
children: "This page is restricted to administrators only. Contact your admin if you need access."
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
})
|
|
191
|
+
}) : se ? /* @__PURE__ */ u("div", {
|
|
192
|
+
className: "max-w-6xl mx-auto p-6",
|
|
193
|
+
children: /* @__PURE__ */ d("div", {
|
|
194
|
+
className: "text-center py-16",
|
|
195
|
+
children: [/* @__PURE__ */ u(i, { className: "w-8 h-8 mx-auto text-text-secondary animate-spin" }), /* @__PURE__ */ u("p", {
|
|
196
|
+
className: "mt-4 text-text-secondary",
|
|
197
|
+
children: "Loading permissions..."
|
|
198
|
+
})]
|
|
199
|
+
})
|
|
200
|
+
}) : !_ || F ? /* @__PURE__ */ u("div", {
|
|
201
|
+
className: "max-w-6xl mx-auto p-6",
|
|
202
|
+
children: /* @__PURE__ */ d("div", {
|
|
203
|
+
className: "text-center py-16 border-2 border-dashed border-border-subtle rounded-xl",
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ u("div", {
|
|
206
|
+
className: "w-16 h-16 mx-auto mb-4 rounded-full bg-status-error-bg-subtle flex items-center justify-center",
|
|
207
|
+
children: /* @__PURE__ */ u("svg", {
|
|
208
|
+
className: "w-8 h-8 text-status-error-text",
|
|
209
|
+
fill: "none",
|
|
210
|
+
viewBox: "0 0 24 24",
|
|
211
|
+
stroke: "currentColor",
|
|
212
|
+
children: /* @__PURE__ */ u("path", {
|
|
213
|
+
strokeLinecap: "round",
|
|
214
|
+
strokeLinejoin: "round",
|
|
215
|
+
strokeWidth: 1.5,
|
|
216
|
+
d: "M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ u("h2", {
|
|
221
|
+
className: "text-xl font-semibold text-text-primary mb-2",
|
|
222
|
+
children: "Admin Access Required"
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ u("p", {
|
|
225
|
+
className: "text-text-secondary mb-4",
|
|
226
|
+
children: "You need administrator privileges to view and manage users."
|
|
227
|
+
}),
|
|
228
|
+
/* @__PURE__ */ u("p", {
|
|
229
|
+
className: "text-sm text-text-secondary",
|
|
230
|
+
children: "Required roles: Super Admin, Tenant Admin, or Org Admin"
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
})
|
|
234
|
+
}) : D === "list" ? /* @__PURE__ */ d("div", {
|
|
235
|
+
className: "max-w-6xl mx-auto p-6",
|
|
236
|
+
children: [
|
|
237
|
+
Z,
|
|
238
|
+
/* @__PURE__ */ u("div", {
|
|
239
|
+
className: "flex items-center justify-between mb-8",
|
|
240
|
+
children: /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h1", {
|
|
241
|
+
className: "text-3xl font-semibold text-text-primary",
|
|
242
|
+
children: "Users"
|
|
243
|
+
}), /* @__PURE__ */ d("p", {
|
|
244
|
+
className: "text-text-secondary mt-2",
|
|
245
|
+
children: [
|
|
246
|
+
"Manage users in your organization (",
|
|
247
|
+
w,
|
|
248
|
+
" total)"
|
|
249
|
+
]
|
|
250
|
+
})] })
|
|
251
|
+
}),
|
|
252
|
+
L && /* @__PURE__ */ d("div", {
|
|
253
|
+
className: "mb-6 p-4 rounded-xl bg-status-success-bg-subtle border border-status-success-border",
|
|
254
|
+
children: [/* @__PURE__ */ u("p", {
|
|
255
|
+
className: "text-status-success-text",
|
|
256
|
+
children: L
|
|
257
|
+
}), /* @__PURE__ */ u("button", {
|
|
258
|
+
onClick: () => R(null),
|
|
259
|
+
className: "mt-2 text-sm text-status-success-text hover:underline",
|
|
260
|
+
children: "Dismiss"
|
|
261
|
+
})]
|
|
262
|
+
}),
|
|
263
|
+
N && /* @__PURE__ */ d("div", {
|
|
264
|
+
className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
|
|
265
|
+
children: [/* @__PURE__ */ u(r, { className: "w-5 h-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ d("div", {
|
|
266
|
+
className: "flex-1",
|
|
267
|
+
children: [/* @__PURE__ */ u("p", {
|
|
268
|
+
className: "text-sm text-status-error-text",
|
|
269
|
+
children: N
|
|
270
|
+
}), /* @__PURE__ */ u("button", {
|
|
271
|
+
onClick: () => P(null),
|
|
272
|
+
className: "mt-2 text-sm text-status-error-text hover:underline",
|
|
273
|
+
children: "Dismiss"
|
|
274
|
+
})]
|
|
275
|
+
})]
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ u("div", {
|
|
278
|
+
className: "mb-6 p-4 rounded-xl border border-border-subtle bg-bg-surface",
|
|
279
|
+
children: /* @__PURE__ */ d("div", {
|
|
280
|
+
className: "flex flex-wrap gap-4",
|
|
281
|
+
children: [
|
|
282
|
+
/* @__PURE__ */ u("input", {
|
|
283
|
+
type: "text",
|
|
284
|
+
placeholder: "Search by email, username, or name...",
|
|
285
|
+
value: V,
|
|
286
|
+
onChange: (e) => {
|
|
287
|
+
H(e.target.value), q(0);
|
|
288
|
+
},
|
|
289
|
+
className: "flex-1 min-w-[200px] px-4 py-2.5 border border-border-default rounded-xl bg-bg-surface text-text-primary placeholder-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ d("select", {
|
|
292
|
+
value: U,
|
|
293
|
+
onChange: (e) => {
|
|
294
|
+
de(e.target.value), q(0);
|
|
295
|
+
},
|
|
296
|
+
className: "px-4 py-2.5 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
297
|
+
children: [/* @__PURE__ */ u("option", {
|
|
298
|
+
value: "",
|
|
299
|
+
children: "All Roles"
|
|
300
|
+
}), f.map((e) => /* @__PURE__ */ u("option", {
|
|
301
|
+
value: e,
|
|
302
|
+
children: e.replace("_", " ")
|
|
303
|
+
}, e))]
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ d("select", {
|
|
306
|
+
value: W,
|
|
307
|
+
onChange: (e) => {
|
|
308
|
+
G(e.target.value), q(0);
|
|
309
|
+
},
|
|
310
|
+
className: "px-4 py-2.5 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
311
|
+
children: [/* @__PURE__ */ u("option", {
|
|
312
|
+
value: "",
|
|
313
|
+
children: "All Statuses"
|
|
314
|
+
}), p.map((e) => /* @__PURE__ */ u("option", {
|
|
315
|
+
value: e,
|
|
316
|
+
children: e
|
|
317
|
+
}, e))]
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
})
|
|
321
|
+
}),
|
|
322
|
+
x ? /* @__PURE__ */ d("div", {
|
|
323
|
+
className: "flex items-center justify-center py-12",
|
|
324
|
+
children: [/* @__PURE__ */ u(i, { className: "w-8 h-8 text-text-link animate-spin" }), /* @__PURE__ */ u("span", {
|
|
325
|
+
className: "ml-3 text-text-secondary",
|
|
326
|
+
children: "Loading users..."
|
|
327
|
+
})]
|
|
328
|
+
}) : S.length === 0 ? /* @__PURE__ */ d("div", {
|
|
329
|
+
className: "text-center py-16 border-2 border-dashed border-border-subtle rounded-xl",
|
|
330
|
+
children: [/* @__PURE__ */ u("div", {
|
|
331
|
+
className: "w-16 h-16 mx-auto mb-4 rounded-full bg-bg-sunken flex items-center justify-center",
|
|
332
|
+
children: /* @__PURE__ */ u("svg", {
|
|
333
|
+
className: "w-8 h-8 text-text-tertiary",
|
|
334
|
+
fill: "none",
|
|
335
|
+
viewBox: "0 0 24 24",
|
|
336
|
+
stroke: "currentColor",
|
|
337
|
+
children: /* @__PURE__ */ u("path", {
|
|
338
|
+
strokeLinecap: "round",
|
|
339
|
+
strokeLinejoin: "round",
|
|
340
|
+
strokeWidth: 1.5,
|
|
341
|
+
d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"
|
|
342
|
+
})
|
|
343
|
+
})
|
|
344
|
+
}), /* @__PURE__ */ u("p", {
|
|
345
|
+
className: "text-text-secondary",
|
|
346
|
+
children: "No users found"
|
|
347
|
+
})]
|
|
348
|
+
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
349
|
+
className: "rounded-xl border border-border-subtle bg-bg-surface overflow-hidden shadow-sm",
|
|
350
|
+
children: /* @__PURE__ */ u("div", {
|
|
351
|
+
className: "overflow-x-auto",
|
|
352
|
+
children: /* @__PURE__ */ d("table", {
|
|
353
|
+
className: "w-full min-w-[800px]",
|
|
354
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ d("tr", {
|
|
355
|
+
className: "border-b border-border-subtle bg-bg-canvas",
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ u("th", {
|
|
358
|
+
className: "text-left py-4 px-4 text-sm font-medium text-text-secondary w-[280px]",
|
|
359
|
+
children: "User"
|
|
360
|
+
}),
|
|
361
|
+
/* @__PURE__ */ u("th", {
|
|
362
|
+
className: "text-left py-4 px-4 text-sm font-medium text-text-secondary w-[130px]",
|
|
363
|
+
children: "Role"
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ u("th", {
|
|
366
|
+
className: "text-left py-4 px-4 text-sm font-medium text-text-secondary w-[100px]",
|
|
367
|
+
children: "Status"
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ u("th", {
|
|
370
|
+
className: "text-left py-4 px-4 text-sm font-medium text-text-secondary w-[80px]",
|
|
371
|
+
children: "Verified"
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ u("th", {
|
|
374
|
+
className: "text-left py-4 px-4 text-sm font-medium text-text-secondary w-[100px]",
|
|
375
|
+
children: "Last Login"
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ u("th", {
|
|
378
|
+
className: "text-right py-4 px-4 text-sm font-medium text-text-secondary w-[180px]",
|
|
379
|
+
children: "Actions"
|
|
380
|
+
})
|
|
381
|
+
]
|
|
382
|
+
}) }), /* @__PURE__ */ u("tbody", { children: S.map((e) => /* @__PURE__ */ d("tr", {
|
|
383
|
+
className: "border-b border-border-subtle last:border-b-0 hover:bg-bg-sunken/50 transition-colors",
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ u("td", {
|
|
386
|
+
className: "py-4 px-4",
|
|
387
|
+
children: /* @__PURE__ */ d("div", {
|
|
388
|
+
className: "flex items-center gap-3 min-w-0",
|
|
389
|
+
children: [/* @__PURE__ */ u("div", {
|
|
390
|
+
className: "auth-brand-badge flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-medium",
|
|
391
|
+
children: (e.name || e.username || e.email).charAt(0).toUpperCase()
|
|
392
|
+
}), /* @__PURE__ */ d("div", {
|
|
393
|
+
className: "min-w-0 flex-1",
|
|
394
|
+
children: [/* @__PURE__ */ u("p", {
|
|
395
|
+
className: "font-medium text-text-primary truncate",
|
|
396
|
+
children: e.name || e.username
|
|
397
|
+
}), /* @__PURE__ */ u("p", {
|
|
398
|
+
className: "text-sm text-text-secondary truncate",
|
|
399
|
+
children: e.email
|
|
400
|
+
})]
|
|
401
|
+
})]
|
|
402
|
+
})
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ u("td", {
|
|
405
|
+
className: "py-4 px-4",
|
|
406
|
+
children: /* @__PURE__ */ u("span", {
|
|
407
|
+
className: `inline-block px-2.5 py-1 rounded-full text-xs font-medium whitespace-nowrap ${Q(e.role)}`,
|
|
408
|
+
children: e.role.replace("_", " ")
|
|
409
|
+
})
|
|
410
|
+
}),
|
|
411
|
+
/* @__PURE__ */ u("td", {
|
|
412
|
+
className: "py-4 px-4",
|
|
413
|
+
children: /* @__PURE__ */ u("span", {
|
|
414
|
+
className: `inline-block px-2.5 py-1 rounded-full text-xs font-medium whitespace-nowrap ${$(e.status)}`,
|
|
415
|
+
children: e.status
|
|
416
|
+
})
|
|
417
|
+
}),
|
|
418
|
+
/* @__PURE__ */ u("td", {
|
|
419
|
+
className: "py-4 px-4",
|
|
420
|
+
children: e.emailVerified ? /* @__PURE__ */ d("span", {
|
|
421
|
+
className: "inline-flex items-center gap-1 text-status-success-text whitespace-nowrap",
|
|
422
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
423
|
+
className: "w-4 h-4 flex-shrink-0",
|
|
424
|
+
fill: "currentColor",
|
|
425
|
+
viewBox: "0 0 20 20",
|
|
426
|
+
children: /* @__PURE__ */ u("path", {
|
|
427
|
+
fillRule: "evenodd",
|
|
428
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
|
429
|
+
clipRule: "evenodd"
|
|
430
|
+
})
|
|
431
|
+
}), /* @__PURE__ */ u("span", {
|
|
432
|
+
className: "text-sm",
|
|
433
|
+
children: "Yes"
|
|
434
|
+
})]
|
|
435
|
+
}) : /* @__PURE__ */ d("span", {
|
|
436
|
+
className: "inline-flex items-center gap-1 text-status-warning-text whitespace-nowrap",
|
|
437
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
438
|
+
className: "w-4 h-4 flex-shrink-0",
|
|
439
|
+
fill: "currentColor",
|
|
440
|
+
viewBox: "0 0 20 20",
|
|
441
|
+
children: /* @__PURE__ */ u("path", {
|
|
442
|
+
fillRule: "evenodd",
|
|
443
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",
|
|
444
|
+
clipRule: "evenodd"
|
|
445
|
+
})
|
|
446
|
+
}), /* @__PURE__ */ u("span", {
|
|
447
|
+
className: "text-sm",
|
|
448
|
+
children: "No"
|
|
449
|
+
})]
|
|
450
|
+
})
|
|
451
|
+
}),
|
|
452
|
+
/* @__PURE__ */ u("td", {
|
|
453
|
+
className: "py-4 px-4 text-sm text-text-secondary whitespace-nowrap",
|
|
454
|
+
children: e.lastLoginAt ? new Date(e.lastLoginAt).toLocaleDateString() : "Never"
|
|
455
|
+
}),
|
|
456
|
+
/* @__PURE__ */ u("td", {
|
|
457
|
+
className: "py-4 px-4",
|
|
458
|
+
children: /* @__PURE__ */ d("div", {
|
|
459
|
+
className: "flex justify-end gap-1.5 flex-nowrap",
|
|
460
|
+
children: [
|
|
461
|
+
/* @__PURE__ */ u("button", {
|
|
462
|
+
onClick: () => m(`/auth/users/${e.id}`),
|
|
463
|
+
className: "px-2.5 py-1.5 rounded-lg text-xs font-medium border border-border-default text-text-primary bg-bg-surface hover:bg-bg-sunken transition-colors whitespace-nowrap flex-shrink-0",
|
|
464
|
+
children: "View"
|
|
465
|
+
}),
|
|
466
|
+
oe && /* @__PURE__ */ u("button", {
|
|
467
|
+
onClick: () => X(e),
|
|
468
|
+
className: "px-2.5 py-1.5 rounded-lg text-xs font-medium border border-status-info-border text-text-link bg-bg-surface hover:bg-status-info-bg-subtle transition-colors whitespace-nowrap flex-shrink-0",
|
|
469
|
+
children: "Edit"
|
|
470
|
+
}),
|
|
471
|
+
v && e.status !== "DELETED" && /* @__PURE__ */ u("button", {
|
|
472
|
+
onClick: () => B({
|
|
473
|
+
type: "deactivate",
|
|
474
|
+
user: e
|
|
475
|
+
}),
|
|
476
|
+
className: "px-2.5 py-1.5 rounded-lg text-xs font-medium border border-status-error-border text-status-error-text bg-bg-surface hover:bg-status-error-bg-subtle transition-colors whitespace-nowrap flex-shrink-0",
|
|
477
|
+
children: "Delete"
|
|
478
|
+
})
|
|
479
|
+
]
|
|
480
|
+
})
|
|
481
|
+
})
|
|
482
|
+
]
|
|
483
|
+
}, e.id)) })]
|
|
484
|
+
})
|
|
485
|
+
})
|
|
486
|
+
}), /* @__PURE__ */ d("div", {
|
|
487
|
+
className: "mt-6 flex items-center justify-between",
|
|
488
|
+
children: [/* @__PURE__ */ d("p", {
|
|
489
|
+
className: "text-sm text-text-secondary",
|
|
490
|
+
children: [
|
|
491
|
+
"Showing ",
|
|
492
|
+
K * 10 + 1,
|
|
493
|
+
" to",
|
|
494
|
+
" ",
|
|
495
|
+
Math.min((K + 1) * 10, w),
|
|
496
|
+
" of",
|
|
497
|
+
" ",
|
|
498
|
+
w,
|
|
499
|
+
" users"
|
|
500
|
+
]
|
|
501
|
+
}), /* @__PURE__ */ d("div", {
|
|
502
|
+
className: "flex gap-2",
|
|
503
|
+
children: [/* @__PURE__ */ u("button", {
|
|
504
|
+
onClick: () => q((e) => Math.max(0, e - 1)),
|
|
505
|
+
disabled: K === 0,
|
|
506
|
+
className: "px-4 py-2 rounded-lg border border-border-default text-text-primary bg-bg-surface disabled:opacity-50 disabled:cursor-not-allowed hover:bg-bg-sunken transition-colors",
|
|
507
|
+
children: "Previous"
|
|
508
|
+
}), /* @__PURE__ */ u("button", {
|
|
509
|
+
onClick: () => q((e) => e + 1),
|
|
510
|
+
disabled: !E,
|
|
511
|
+
className: "px-4 py-2 rounded-lg border border-border-default text-text-primary bg-bg-surface disabled:opacity-50 disabled:cursor-not-allowed hover:bg-bg-sunken transition-colors",
|
|
512
|
+
children: "Next"
|
|
513
|
+
})]
|
|
514
|
+
})]
|
|
515
|
+
})] })
|
|
516
|
+
]
|
|
517
|
+
}) : D === "view" && k ? /* @__PURE__ */ d("div", {
|
|
518
|
+
className: "max-w-4xl mx-auto p-6",
|
|
519
|
+
children: [
|
|
520
|
+
Z,
|
|
521
|
+
/* @__PURE__ */ d("button", {
|
|
522
|
+
onClick: () => {
|
|
523
|
+
O("list"), Y();
|
|
524
|
+
},
|
|
525
|
+
className: "mb-6 flex items-center gap-2 text-text-link hover:underline font-medium",
|
|
526
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
527
|
+
className: "w-4 h-4",
|
|
528
|
+
fill: "none",
|
|
529
|
+
viewBox: "0 0 24 24",
|
|
530
|
+
stroke: "currentColor",
|
|
531
|
+
children: /* @__PURE__ */ u("path", {
|
|
532
|
+
strokeLinecap: "round",
|
|
533
|
+
strokeLinejoin: "round",
|
|
534
|
+
strokeWidth: 2,
|
|
535
|
+
d: "M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
536
|
+
})
|
|
537
|
+
}), "Back to Users"]
|
|
538
|
+
}),
|
|
539
|
+
/* @__PURE__ */ d("div", {
|
|
540
|
+
className: "p-6 rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ d("div", {
|
|
543
|
+
className: "flex items-center gap-4 mb-8",
|
|
544
|
+
children: [/* @__PURE__ */ u("div", {
|
|
545
|
+
className: "auth-brand-badge flex h-20 w-20 items-center justify-center rounded-full text-3xl font-semibold",
|
|
546
|
+
children: (k.name || k.username || k.email).charAt(0).toUpperCase()
|
|
547
|
+
}), /* @__PURE__ */ d("div", { children: [
|
|
548
|
+
/* @__PURE__ */ u("h1", {
|
|
549
|
+
className: "text-2xl font-semibold text-text-primary",
|
|
550
|
+
children: k.name || k.username
|
|
551
|
+
}),
|
|
552
|
+
/* @__PURE__ */ u("p", {
|
|
553
|
+
className: "text-text-secondary",
|
|
554
|
+
children: k.email
|
|
555
|
+
}),
|
|
556
|
+
/* @__PURE__ */ d("div", {
|
|
557
|
+
className: "flex items-center gap-2 mt-2",
|
|
558
|
+
children: [/* @__PURE__ */ u("span", {
|
|
559
|
+
className: `px-2.5 py-1 rounded-full text-xs font-medium ${Q(k.role)}`,
|
|
560
|
+
children: k.role.replace("_", " ")
|
|
561
|
+
}), /* @__PURE__ */ u("span", {
|
|
562
|
+
className: `px-2.5 py-1 rounded-full text-xs font-medium ${$(k.status)}`,
|
|
563
|
+
children: k.status
|
|
564
|
+
})]
|
|
565
|
+
})
|
|
566
|
+
] })]
|
|
567
|
+
}),
|
|
568
|
+
/* @__PURE__ */ d("div", {
|
|
569
|
+
className: "grid grid-cols-2 gap-6",
|
|
570
|
+
children: [
|
|
571
|
+
/* @__PURE__ */ d("div", {
|
|
572
|
+
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
573
|
+
children: [/* @__PURE__ */ u("label", {
|
|
574
|
+
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
575
|
+
children: "Username"
|
|
576
|
+
}), /* @__PURE__ */ u("p", {
|
|
577
|
+
className: "text-text-primary font-medium",
|
|
578
|
+
children: k.username
|
|
579
|
+
})]
|
|
580
|
+
}),
|
|
581
|
+
/* @__PURE__ */ d("div", {
|
|
582
|
+
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
583
|
+
children: [/* @__PURE__ */ u("label", {
|
|
584
|
+
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
585
|
+
children: "Email"
|
|
586
|
+
}), /* @__PURE__ */ u("p", {
|
|
587
|
+
className: "text-text-primary font-medium",
|
|
588
|
+
children: k.email
|
|
589
|
+
})]
|
|
590
|
+
}),
|
|
591
|
+
/* @__PURE__ */ d("div", {
|
|
592
|
+
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
593
|
+
children: [/* @__PURE__ */ u("label", {
|
|
594
|
+
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
595
|
+
children: "Email Verified"
|
|
596
|
+
}), /* @__PURE__ */ u("p", {
|
|
597
|
+
className: "text-text-primary font-medium",
|
|
598
|
+
children: k.emailVerified ? /* @__PURE__ */ u("span", {
|
|
599
|
+
className: "text-status-success-text",
|
|
600
|
+
children: "Yes"
|
|
601
|
+
}) : /* @__PURE__ */ u("span", {
|
|
602
|
+
className: "text-status-warning-text",
|
|
603
|
+
children: "No"
|
|
604
|
+
})
|
|
605
|
+
})]
|
|
606
|
+
}),
|
|
607
|
+
/* @__PURE__ */ d("div", {
|
|
608
|
+
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
609
|
+
children: [/* @__PURE__ */ u("label", {
|
|
610
|
+
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
611
|
+
children: "MFA Enabled"
|
|
612
|
+
}), /* @__PURE__ */ u("p", {
|
|
613
|
+
className: "text-text-primary font-medium",
|
|
614
|
+
children: k.mfaEnabled ? /* @__PURE__ */ u("span", {
|
|
615
|
+
className: "text-status-success-text",
|
|
616
|
+
children: "Yes"
|
|
617
|
+
}) : /* @__PURE__ */ u("span", {
|
|
618
|
+
className: "text-text-secondary",
|
|
619
|
+
children: "No"
|
|
620
|
+
})
|
|
621
|
+
})]
|
|
622
|
+
}),
|
|
623
|
+
k.phoneNumber && /* @__PURE__ */ d("div", {
|
|
624
|
+
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
625
|
+
children: [/* @__PURE__ */ u("label", {
|
|
626
|
+
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
627
|
+
children: "Phone Number"
|
|
628
|
+
}), /* @__PURE__ */ u("p", {
|
|
629
|
+
className: "text-text-primary font-medium",
|
|
630
|
+
children: k.phoneNumber
|
|
631
|
+
})]
|
|
632
|
+
}),
|
|
633
|
+
/* @__PURE__ */ d("div", {
|
|
634
|
+
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
635
|
+
children: [/* @__PURE__ */ u("label", {
|
|
636
|
+
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
637
|
+
children: "Last Login"
|
|
638
|
+
}), /* @__PURE__ */ u("p", {
|
|
639
|
+
className: "text-text-primary font-medium",
|
|
640
|
+
children: k.lastLoginAt ? new Date(k.lastLoginAt).toLocaleString() : "Never"
|
|
641
|
+
})]
|
|
642
|
+
}),
|
|
643
|
+
/* @__PURE__ */ d("div", {
|
|
644
|
+
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
645
|
+
children: [/* @__PURE__ */ u("label", {
|
|
646
|
+
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
647
|
+
children: "Created"
|
|
648
|
+
}), /* @__PURE__ */ u("p", {
|
|
649
|
+
className: "text-text-primary font-medium",
|
|
650
|
+
children: new Date(k.createdAt).toLocaleString()
|
|
651
|
+
})]
|
|
652
|
+
}),
|
|
653
|
+
/* @__PURE__ */ d("div", {
|
|
654
|
+
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
655
|
+
children: [/* @__PURE__ */ u("label", {
|
|
656
|
+
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
657
|
+
children: "Last Updated"
|
|
658
|
+
}), /* @__PURE__ */ u("p", {
|
|
659
|
+
className: "text-text-primary font-medium",
|
|
660
|
+
children: new Date(k.updatedAt).toLocaleString()
|
|
661
|
+
})]
|
|
662
|
+
})
|
|
663
|
+
]
|
|
664
|
+
}),
|
|
665
|
+
/* @__PURE__ */ d("div", {
|
|
666
|
+
className: "mt-8 pt-6 border-t border-border-subtle flex gap-3",
|
|
667
|
+
children: [
|
|
668
|
+
/* @__PURE__ */ u("button", {
|
|
669
|
+
onClick: () => X(k),
|
|
670
|
+
className: "auth-primary-button px-4 py-2.5 font-medium",
|
|
671
|
+
children: "Edit User"
|
|
672
|
+
}),
|
|
673
|
+
k.status !== "DELETED" && /* @__PURE__ */ u("button", {
|
|
674
|
+
onClick: () => B({
|
|
675
|
+
type: "deactivate",
|
|
676
|
+
user: k
|
|
677
|
+
}),
|
|
678
|
+
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",
|
|
679
|
+
children: "Delete User"
|
|
680
|
+
}),
|
|
681
|
+
v && k.status === "DELETED" && /* @__PURE__ */ u("button", {
|
|
682
|
+
onClick: () => B({
|
|
683
|
+
type: "hard-delete",
|
|
684
|
+
user: k
|
|
685
|
+
}),
|
|
686
|
+
className: "px-4 py-2.5 rounded-xl bg-status-error-bg text-white font-medium hover:bg-status-error-bg-hover transition-colors",
|
|
687
|
+
children: "Permanently Delete"
|
|
688
|
+
})
|
|
689
|
+
]
|
|
690
|
+
})
|
|
691
|
+
]
|
|
692
|
+
})
|
|
693
|
+
]
|
|
694
|
+
}) : /* @__PURE__ */ d("div", {
|
|
695
|
+
className: "max-w-2xl mx-auto p-6",
|
|
696
|
+
children: [
|
|
697
|
+
Z,
|
|
698
|
+
/* @__PURE__ */ d("button", {
|
|
699
|
+
onClick: () => {
|
|
700
|
+
O("list"), Y();
|
|
701
|
+
},
|
|
702
|
+
className: "mb-6 flex items-center gap-2 text-text-link hover:underline font-medium",
|
|
703
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
704
|
+
className: "w-4 h-4",
|
|
705
|
+
fill: "none",
|
|
706
|
+
viewBox: "0 0 24 24",
|
|
707
|
+
stroke: "currentColor",
|
|
708
|
+
children: /* @__PURE__ */ u("path", {
|
|
709
|
+
strokeLinecap: "round",
|
|
710
|
+
strokeLinejoin: "round",
|
|
711
|
+
strokeWidth: 2,
|
|
712
|
+
d: "M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
713
|
+
})
|
|
714
|
+
}), "Back to Users"]
|
|
715
|
+
}),
|
|
716
|
+
/* @__PURE__ */ d("div", {
|
|
717
|
+
className: "p-6 rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
|
|
718
|
+
children: [
|
|
719
|
+
/* @__PURE__ */ u("h1", {
|
|
720
|
+
className: "text-2xl font-semibold text-text-primary mb-2",
|
|
721
|
+
children: "Edit User"
|
|
722
|
+
}),
|
|
723
|
+
k && /* @__PURE__ */ d("p", {
|
|
724
|
+
className: "text-text-secondary mb-6",
|
|
725
|
+
children: ["Editing: ", /* @__PURE__ */ u("strong", { children: k.email })]
|
|
726
|
+
}),
|
|
727
|
+
N && /* @__PURE__ */ d("div", {
|
|
728
|
+
className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
|
|
729
|
+
children: [/* @__PURE__ */ u(r, { className: "w-5 h-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ u("div", {
|
|
730
|
+
className: "flex-1",
|
|
731
|
+
children: /* @__PURE__ */ u("p", {
|
|
732
|
+
className: "text-sm text-status-error-text",
|
|
733
|
+
children: N
|
|
734
|
+
})
|
|
735
|
+
})]
|
|
736
|
+
}),
|
|
737
|
+
/* @__PURE__ */ d("form", {
|
|
738
|
+
onSubmit: fe,
|
|
739
|
+
className: "space-y-6",
|
|
740
|
+
children: [
|
|
741
|
+
/* @__PURE__ */ d("div", {
|
|
742
|
+
className: "grid grid-cols-2 gap-4",
|
|
743
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
744
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
745
|
+
children: "Username"
|
|
746
|
+
}), /* @__PURE__ */ u("input", {
|
|
747
|
+
type: "text",
|
|
748
|
+
value: j.username,
|
|
749
|
+
onChange: (e) => M({
|
|
750
|
+
...j,
|
|
751
|
+
username: e.target.value
|
|
752
|
+
}),
|
|
753
|
+
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
754
|
+
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
755
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
756
|
+
children: "Name"
|
|
757
|
+
}), /* @__PURE__ */ u("input", {
|
|
758
|
+
type: "text",
|
|
759
|
+
value: j.name,
|
|
760
|
+
onChange: (e) => M({
|
|
761
|
+
...j,
|
|
762
|
+
name: e.target.value
|
|
763
|
+
}),
|
|
764
|
+
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
765
|
+
})] })]
|
|
766
|
+
}),
|
|
767
|
+
/* @__PURE__ */ d("div", {
|
|
768
|
+
className: "grid grid-cols-2 gap-4",
|
|
769
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
770
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
771
|
+
children: "First Name"
|
|
772
|
+
}), /* @__PURE__ */ u("input", {
|
|
773
|
+
type: "text",
|
|
774
|
+
value: j.firstName,
|
|
775
|
+
onChange: (e) => M({
|
|
776
|
+
...j,
|
|
777
|
+
firstName: e.target.value
|
|
778
|
+
}),
|
|
779
|
+
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
780
|
+
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
781
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
782
|
+
children: "Last Name"
|
|
783
|
+
}), /* @__PURE__ */ u("input", {
|
|
784
|
+
type: "text",
|
|
785
|
+
value: j.lastName,
|
|
786
|
+
onChange: (e) => M({
|
|
787
|
+
...j,
|
|
788
|
+
lastName: e.target.value
|
|
789
|
+
}),
|
|
790
|
+
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
791
|
+
})] })]
|
|
792
|
+
}),
|
|
793
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
794
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
795
|
+
children: "Phone Number"
|
|
796
|
+
}), /* @__PURE__ */ u("input", {
|
|
797
|
+
type: "tel",
|
|
798
|
+
value: j.phoneNumber,
|
|
799
|
+
onChange: (e) => M({
|
|
800
|
+
...j,
|
|
801
|
+
phoneNumber: e.target.value
|
|
802
|
+
}),
|
|
803
|
+
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
804
|
+
})] }),
|
|
805
|
+
/* @__PURE__ */ d("div", {
|
|
806
|
+
className: "grid grid-cols-2 gap-4",
|
|
807
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
808
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
809
|
+
children: "Role"
|
|
810
|
+
}), /* @__PURE__ */ u("select", {
|
|
811
|
+
value: j.role,
|
|
812
|
+
onChange: (e) => M({
|
|
813
|
+
...j,
|
|
814
|
+
role: e.target.value
|
|
815
|
+
}),
|
|
816
|
+
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
817
|
+
children: f.map((e) => /* @__PURE__ */ u("option", {
|
|
818
|
+
value: e,
|
|
819
|
+
children: e.replace("_", " ")
|
|
820
|
+
}, e))
|
|
821
|
+
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
822
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
823
|
+
children: "Status"
|
|
824
|
+
}), /* @__PURE__ */ u("select", {
|
|
825
|
+
value: j.status,
|
|
826
|
+
onChange: (e) => M({
|
|
827
|
+
...j,
|
|
828
|
+
status: e.target.value
|
|
829
|
+
}),
|
|
830
|
+
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
|
|
831
|
+
children: p.map((e) => /* @__PURE__ */ u("option", {
|
|
832
|
+
value: e,
|
|
833
|
+
children: e
|
|
834
|
+
}, e))
|
|
835
|
+
})] })]
|
|
836
|
+
}),
|
|
837
|
+
/* @__PURE__ */ d("div", {
|
|
838
|
+
className: "flex items-center gap-3 p-4 rounded-xl bg-bg-canvas/50",
|
|
839
|
+
children: [/* @__PURE__ */ u("input", {
|
|
840
|
+
type: "checkbox",
|
|
841
|
+
id: "emailVerified",
|
|
842
|
+
checked: j.emailVerified,
|
|
843
|
+
onChange: (e) => M({
|
|
844
|
+
...j,
|
|
845
|
+
emailVerified: e.target.checked
|
|
846
|
+
}),
|
|
847
|
+
className: "w-5 h-5 rounded border-border-default text-text-link focus:ring-action-primary-bg"
|
|
848
|
+
}), /* @__PURE__ */ u("label", {
|
|
849
|
+
htmlFor: "emailVerified",
|
|
850
|
+
className: "text-sm font-medium text-text-primary",
|
|
851
|
+
children: "Email Verified"
|
|
852
|
+
})]
|
|
853
|
+
}),
|
|
854
|
+
/* @__PURE__ */ d("div", {
|
|
855
|
+
className: "flex gap-3 pt-4",
|
|
856
|
+
children: [/* @__PURE__ */ u("button", {
|
|
857
|
+
type: "submit",
|
|
858
|
+
disabled: x,
|
|
859
|
+
className: "auth-primary-button flex items-center gap-2 px-6 py-3 font-medium",
|
|
860
|
+
children: x ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(i, { className: "w-4 h-4 animate-spin" }), "Saving..."] }) : "Save Changes"
|
|
861
|
+
}), /* @__PURE__ */ u("button", {
|
|
862
|
+
type: "button",
|
|
863
|
+
onClick: () => {
|
|
864
|
+
O("list"), Y();
|
|
865
|
+
},
|
|
866
|
+
className: "px-6 py-3 rounded-xl border border-border-default text-text-primary font-medium hover:bg-bg-sunken transition-colors",
|
|
867
|
+
children: "Cancel"
|
|
868
|
+
})]
|
|
869
|
+
})
|
|
870
|
+
]
|
|
871
|
+
})
|
|
872
|
+
]
|
|
873
|
+
})
|
|
874
|
+
]
|
|
875
|
+
}) : /* @__PURE__ */ u("div", {
|
|
876
|
+
className: "max-w-6xl mx-auto p-6",
|
|
877
|
+
children: /* @__PURE__ */ d("div", {
|
|
878
|
+
className: "text-center py-16 border-2 border-dashed border-border-subtle rounded-xl",
|
|
879
|
+
children: [
|
|
880
|
+
/* @__PURE__ */ u("div", {
|
|
881
|
+
className: "w-16 h-16 mx-auto mb-4 rounded-full bg-status-warning-bg-subtle flex items-center justify-center",
|
|
882
|
+
children: /* @__PURE__ */ u(r, { className: "w-8 h-8 text-status-warning-text" })
|
|
883
|
+
}),
|
|
884
|
+
/* @__PURE__ */ u("h2", {
|
|
885
|
+
className: "text-xl font-semibold text-text-primary mb-2",
|
|
886
|
+
children: ae("auth.users.authRequired", "Authentication Required")
|
|
887
|
+
}),
|
|
888
|
+
/* @__PURE__ */ u("p", {
|
|
889
|
+
className: "text-text-secondary",
|
|
890
|
+
children: "Please sign in to manage users"
|
|
891
|
+
})
|
|
892
|
+
]
|
|
893
|
+
})
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
//#endregion
|
|
897
|
+
export { m as UsersPage };
|
|
898
|
+
|
|
899
|
+
//# sourceMappingURL=UsersPage.js.map
|