@better-auth-ui/heroui 1.6.7 → 1.6.9
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/components/auth/additional-field.d.ts +2 -2
- package/dist/components/auth/additional-field.js +133 -266
- package/dist/components/auth/api-key/api-key-skeleton.js +4 -20
- package/dist/components/auth/api-key/api-key.d.ts +6 -2
- package/dist/components/auth/api-key/api-key.js +16 -54
- package/dist/components/auth/api-key/api-keys-empty.d.ts +3 -1
- package/dist/components/auth/api-key/api-keys-empty.js +8 -34
- package/dist/components/auth/api-key/api-keys.d.ts +10 -2
- package/dist/components/auth/api-key/api-keys.js +21 -40
- package/dist/components/auth/api-key/create-api-key-dialog.d.ts +3 -1
- package/dist/components/auth/api-key/create-api-key-dialog.js +43 -73
- package/dist/components/auth/api-key/delete-api-key-dialog.d.ts +4 -2
- package/dist/components/auth/api-key/delete-api-key-dialog.js +16 -50
- package/dist/components/auth/api-key/new-api-key-dialog.js +23 -59
- package/dist/components/auth/api-key/organization-api-keys.d.ts +14 -0
- package/dist/components/auth/api-key/organization-api-keys.js +22 -0
- package/dist/components/auth/auth-provider.d.ts +1 -1
- package/dist/components/auth/auth-provider.js +10 -16
- package/dist/components/auth/auth.d.ts +3 -3
- package/dist/components/auth/auth.js +86 -61
- package/dist/components/auth/delete-user/danger-zone.d.ts +3 -3
- package/dist/components/auth/delete-user/danger-zone.js +11 -17
- package/dist/components/auth/delete-user/delete-account.d.ts +9 -0
- package/dist/components/auth/delete-user/delete-account.js +50 -0
- package/dist/components/auth/email/email-changed-email.d.ts +2 -2
- package/dist/components/auth/email/email-changed-email.js +22 -29
- package/dist/components/auth/email/email-verification-email.d.ts +2 -2
- package/dist/components/auth/email/email-verification-email.js +22 -29
- package/dist/components/auth/email/magic-link-email.d.ts +2 -2
- package/dist/components/auth/email/magic-link-email.js +22 -29
- package/dist/components/auth/email/new-device-email.d.ts +2 -2
- package/dist/components/auth/email/new-device-email.js +22 -29
- package/dist/components/auth/email/organization-invitation-email.d.ts +3 -0
- package/dist/components/auth/email/organization-invitation-email.js +23 -0
- package/dist/components/auth/email/otp-email.d.ts +2 -2
- package/dist/components/auth/email/otp-email.js +21 -28
- package/dist/components/auth/email/password-changed-email.d.ts +2 -2
- package/dist/components/auth/email/password-changed-email.js +22 -29
- package/dist/components/auth/email/reset-password-email.d.ts +2 -2
- package/dist/components/auth/email/reset-password-email.js +22 -29
- package/dist/components/auth/error-toaster.js +32 -16
- package/dist/components/auth/field-separator.d.ts +1 -1
- package/dist/components/auth/field-separator.js +4 -17
- package/dist/components/auth/forgot-password.d.ts +1 -1
- package/dist/components/auth/forgot-password.js +36 -88
- package/dist/components/auth/magic-link/magic-link-button.d.ts +1 -1
- package/dist/components/auth/magic-link/magic-link-button.js +33 -19
- package/dist/components/auth/magic-link/magic-link.d.ts +2 -2
- package/dist/components/auth/magic-link/magic-link.js +39 -86
- package/dist/components/auth/multi-session/manage-account.d.ts +1 -1
- package/dist/components/auth/multi-session/manage-account.js +32 -48
- package/dist/components/auth/multi-session/manage-accounts.d.ts +1 -1
- package/dist/components/auth/multi-session/manage-accounts.js +32 -33
- package/dist/components/auth/multi-session/switch-account-submenu-content.d.ts +3 -1
- package/dist/components/auth/multi-session/switch-account-submenu-content.js +24 -27
- package/dist/components/auth/multi-session/switch-account-submenu-item.d.ts +3 -2
- package/dist/components/auth/multi-session/switch-account-submenu-item.js +16 -19
- package/dist/components/auth/multi-session/switch-account-submenu.d.ts +2 -1
- package/dist/components/auth/multi-session/switch-account-submenu.js +23 -23
- package/dist/components/auth/organization/change-organization-logo.d.ts +4 -0
- package/dist/components/auth/organization/change-organization-logo.js +69 -0
- package/dist/components/auth/organization/create-organization-dialog.d.ts +13 -0
- package/dist/components/auth/organization/create-organization-dialog.js +37 -0
- package/dist/components/auth/organization/delete-organization-dialog.d.ts +7 -0
- package/dist/components/auth/organization/delete-organization-dialog.js +25 -0
- package/dist/components/auth/organization/delete-organization-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/delete-organization-skeleton.js +8 -0
- package/dist/components/auth/organization/delete-organization.d.ts +5 -0
- package/dist/components/auth/organization/delete-organization.js +27 -0
- package/dist/components/auth/organization/invite-member-dialog.d.ts +13 -0
- package/dist/components/auth/organization/invite-member-dialog.js +47 -0
- package/dist/components/auth/organization/leave-organization-dialog.d.ts +7 -0
- package/dist/components/auth/organization/leave-organization-dialog.js +21 -0
- package/dist/components/auth/organization/leave-organization.d.ts +4 -0
- package/dist/components/auth/organization/leave-organization.js +16 -0
- package/dist/components/auth/organization/organization-danger-zone.d.ts +16 -0
- package/dist/components/auth/organization/organization-danger-zone.js +23 -0
- package/dist/components/auth/organization/organization-invitation-row-skeleton.d.ts +5 -0
- package/dist/components/auth/organization/organization-invitation-row-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-invitation-row.d.ts +5 -0
- package/dist/components/auth/organization/organization-invitation-row.js +31 -0
- package/dist/components/auth/organization/organization-invitations-empty.d.ts +8 -0
- package/dist/components/auth/organization/organization-invitations-empty.js +13 -0
- package/dist/components/auth/organization/organization-invitations.d.ts +9 -0
- package/dist/components/auth/organization/organization-invitations.js +66 -0
- package/dist/components/auth/organization/organization-logo.d.ts +15 -0
- package/dist/components/auth/organization/organization-logo.js +14 -0
- package/dist/components/auth/organization/organization-member-row-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/organization-member-row-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-member-row.d.ts +9 -0
- package/dist/components/auth/organization/organization-member-row.js +34 -0
- package/dist/components/auth/organization/organization-members.d.ts +9 -0
- package/dist/components/auth/organization/organization-members.js +67 -0
- package/dist/components/auth/organization/organization-people.d.ts +10 -0
- package/dist/components/auth/organization/organization-people.js +11 -0
- package/dist/components/auth/organization/organization-profile.d.ts +9 -0
- package/dist/components/auth/organization/organization-profile.js +34 -0
- package/dist/components/auth/organization/organization-row.d.ts +8 -0
- package/dist/components/auth/organization/organization-row.js +31 -0
- package/dist/components/auth/organization/organization-settings.d.ts +12 -0
- package/dist/components/auth/organization/organization-settings.js +13 -0
- package/dist/components/auth/organization/organization-switcher.d.ts +20 -0
- package/dist/components/auth/organization/organization-switcher.js +48 -0
- package/dist/components/auth/organization/organization-view-skeleton.d.ts +6 -0
- package/dist/components/auth/organization/organization-view-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-view.d.ts +15 -0
- package/dist/components/auth/organization/organization-view.js +31 -0
- package/dist/components/auth/organization/organization.d.ts +17 -0
- package/dist/components/auth/organization/organization.js +60 -0
- package/dist/components/auth/organization/organizations-empty.d.ts +4 -0
- package/dist/components/auth/organization/organizations-empty.js +9 -0
- package/dist/components/auth/organization/organizations-settings.d.ts +17 -0
- package/dist/components/auth/organization/organizations-settings.js +17 -0
- package/dist/components/auth/organization/organizations.d.ts +10 -0
- package/dist/components/auth/organization/organizations.js +21 -0
- package/dist/components/auth/organization/remove-member-dialog.d.ts +9 -0
- package/dist/components/auth/organization/remove-member-dialog.js +20 -0
- package/dist/components/auth/organization/slug-field.d.ts +19 -0
- package/dist/components/auth/organization/slug-field.js +38 -0
- package/dist/components/auth/organization/user-invitation-row-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/user-invitation-row-skeleton.js +8 -0
- package/dist/components/auth/organization/user-invitation-row.d.ts +10 -0
- package/dist/components/auth/organization/user-invitation-row.js +22 -0
- package/dist/components/auth/organization/user-invitations-empty.d.ts +4 -0
- package/dist/components/auth/organization/user-invitations-empty.js +12 -0
- package/dist/components/auth/organization/user-invitations.d.ts +10 -0
- package/dist/components/auth/organization/user-invitations.js +18 -0
- package/dist/components/auth/passkey/add-passkey-dialog.d.ts +5 -0
- package/dist/components/auth/passkey/add-passkey-dialog.js +22 -0
- package/dist/components/auth/passkey/delete-passkey-dialog.d.ts +11 -0
- package/dist/components/auth/passkey/delete-passkey-dialog.js +14 -0
- package/dist/components/auth/passkey/passkey-button.d.ts +1 -1
- package/dist/components/auth/passkey/passkey-button.js +24 -23
- package/dist/components/auth/passkey/passkey-skeleton.d.ts +1 -0
- package/dist/components/auth/passkey/passkey-skeleton.js +5 -0
- package/dist/components/auth/passkey/passkey.d.ts +2 -5
- package/dist/components/auth/passkey/passkey.js +16 -44
- package/dist/components/auth/passkey/passkeys-empty.d.ts +4 -0
- package/dist/components/auth/passkey/passkeys-empty.js +9 -0
- package/dist/components/auth/passkey/passkeys.d.ts +1 -1
- package/dist/components/auth/passkey/passkeys.js +15 -105
- package/dist/components/auth/provider-button.d.ts +2 -2
- package/dist/components/auth/provider-button.js +28 -24
- package/dist/components/auth/provider-buttons.js +28 -18
- package/dist/components/auth/reset-password.d.ts +1 -1
- package/dist/components/auth/reset-password.js +56 -146
- package/dist/components/auth/settings/account/account-settings.d.ts +2 -2
- package/dist/components/auth/settings/account/account-settings.js +21 -19
- package/dist/components/auth/settings/account/change-avatar.js +53 -88
- package/dist/components/auth/settings/account/change-email.d.ts +1 -1
- package/dist/components/auth/settings/account/change-email.js +27 -53
- package/dist/components/auth/settings/account/user-profile.d.ts +1 -1
- package/dist/components/auth/settings/account/user-profile.js +64 -85
- package/dist/components/auth/settings/security/active-session.d.ts +1 -1
- package/dist/components/auth/settings/security/active-session.js +50 -57
- package/dist/components/auth/settings/security/active-sessions.d.ts +1 -1
- package/dist/components/auth/settings/security/active-sessions.js +21 -32
- package/dist/components/auth/settings/security/change-password.d.ts +1 -1
- package/dist/components/auth/settings/security/change-password.js +76 -186
- package/dist/components/auth/settings/security/linked-account.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-account.js +37 -55
- package/dist/components/auth/settings/security/linked-accounts.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-accounts.js +34 -43
- package/dist/components/auth/settings/security/security-settings.d.ts +2 -2
- package/dist/components/auth/settings/security/security-settings.js +19 -21
- package/dist/components/auth/settings/settings.d.ts +4 -4
- package/dist/components/auth/settings/settings.js +52 -44
- package/dist/components/auth/sign-in.d.ts +2 -2
- package/dist/components/auth/sign-in.js +63 -132
- package/dist/components/auth/sign-out.js +32 -26
- package/dist/components/auth/sign-up.d.ts +2 -2
- package/dist/components/auth/sign-up.js +97 -211
- package/dist/components/auth/theme/appearance.d.ts +1 -1
- package/dist/components/auth/theme/appearance.js +23 -71
- package/dist/components/auth/theme/theme-toggle-item.js +56 -61
- package/dist/components/auth/user/user-avatar.d.ts +4 -4
- package/dist/components/auth/user/user-avatar.js +31 -28
- package/dist/components/auth/user/user-button.d.ts +6 -7
- package/dist/components/auth/user/user-button.js +38 -72
- package/dist/components/auth/user/user-view.d.ts +13 -7
- package/dist/components/auth/user/user-view.js +26 -36
- package/dist/components/auth/username/sign-in-username.d.ts +2 -2
- package/dist/components/auth/username/sign-in-username.js +87 -147
- package/dist/components/auth/username/username-field.d.ts +1 -1
- package/dist/components/auth/username/username-field.js +44 -52
- package/dist/email.d.ts +8 -7
- package/dist/email.js +8 -8
- package/dist/index.d.ts +21 -21
- package/dist/index.js +21 -22
- package/dist/lib/auth/api-key-plugin.d.ts +7 -4
- package/dist/lib/auth/api-key-plugin.js +12 -10
- package/dist/lib/auth/auth-plugin.d.ts +10 -6
- package/dist/lib/auth/auth-plugin.js +1 -0
- package/dist/lib/auth/delete-user-plugin.d.ts +6 -6
- package/dist/lib/auth/delete-user-plugin.js +6 -9
- package/dist/lib/auth/magic-link-plugin.d.ts +5 -5
- package/dist/lib/auth/magic-link-plugin.js +17 -12
- package/dist/lib/auth/multi-session-plugin.d.ts +5 -5
- package/dist/lib/auth/multi-session-plugin.js +8 -11
- package/dist/lib/auth/organization-plugin.d.ts +37 -0
- package/dist/lib/auth/organization-plugin.js +19 -0
- package/dist/lib/auth/passkey-plugin.d.ts +9 -6
- package/dist/lib/auth/passkey-plugin.js +8 -11
- package/dist/lib/auth/theme-plugin.d.ts +6 -6
- package/dist/lib/auth/theme-plugin.js +25 -22
- package/dist/lib/auth/username-plugin.d.ts +11 -11
- package/dist/lib/auth/username-plugin.js +18 -17
- package/dist/plugins.d.ts +46 -22
- package/dist/plugins.js +47 -22
- package/package.json +25 -19
- package/src/components/auth/api-key/api-key.tsx +25 -16
- package/src/components/auth/api-key/api-keys-empty.tsx +8 -4
- package/src/components/auth/api-key/api-keys.tsx +52 -14
- package/src/components/auth/api-key/create-api-key-dialog.tsx +17 -4
- package/src/components/auth/api-key/delete-api-key-dialog.tsx +10 -2
- package/src/components/auth/api-key/organization-api-keys.tsx +55 -0
- package/src/components/auth/delete-user/danger-zone.tsx +3 -3
- package/src/components/auth/delete-user/{delete-user.tsx → delete-account.tsx} +9 -9
- package/src/components/auth/email/organization-invitation-email.tsx +38 -0
- package/src/components/auth/error-toaster.tsx +28 -10
- package/src/components/auth/forgot-password.tsx +10 -2
- package/src/components/auth/multi-session/manage-accounts.tsx +1 -1
- package/src/components/auth/multi-session/switch-account-submenu-content.tsx +7 -2
- package/src/components/auth/multi-session/switch-account-submenu-item.tsx +4 -2
- package/src/components/auth/multi-session/switch-account-submenu.tsx +8 -4
- package/src/components/auth/organization/change-organization-logo.tsx +171 -0
- package/src/components/auth/organization/create-organization-dialog.tsx +133 -0
- package/src/components/auth/organization/delete-organization-dialog.tsx +97 -0
- package/src/components/auth/organization/delete-organization-skeleton.tsx +17 -0
- package/src/components/auth/organization/delete-organization.tsx +77 -0
- package/src/components/auth/organization/invite-member-dialog.tsx +177 -0
- package/src/components/auth/organization/leave-organization-dialog.tsx +95 -0
- package/src/components/auth/organization/leave-organization.tsx +59 -0
- package/src/components/auth/organization/organization-danger-zone.tsx +68 -0
- package/src/components/auth/organization/organization-invitation-row-skeleton.tsx +29 -0
- package/src/components/auth/organization/organization-invitation-row.tsx +97 -0
- package/src/components/auth/organization/organization-invitations-empty.tsx +39 -0
- package/src/components/auth/organization/organization-invitations.tsx +351 -0
- package/src/components/auth/organization/organization-logo.tsx +64 -0
- package/src/components/auth/organization/organization-member-row-skeleton.tsx +24 -0
- package/src/components/auth/organization/organization-member-row.tsx +157 -0
- package/src/components/auth/organization/organization-members.tsx +284 -0
- package/src/components/auth/organization/organization-people.tsx +26 -0
- package/src/components/auth/organization/organization-profile.tsx +141 -0
- package/src/components/auth/organization/organization-row.tsx +66 -0
- package/src/components/auth/organization/organization-settings.tsx +38 -0
- package/src/components/auth/organization/organization-switcher.tsx +233 -0
- package/src/components/auth/organization/organization-view-skeleton.tsx +36 -0
- package/src/components/auth/organization/organization-view.tsx +109 -0
- package/src/components/auth/organization/organization.tsx +162 -0
- package/src/components/auth/organization/organizations-empty.tsx +35 -0
- package/src/components/auth/organization/organizations-settings.tsx +36 -0
- package/src/components/auth/organization/organizations.tsx +80 -0
- package/src/components/auth/organization/remove-member-dialog.tsx +95 -0
- package/src/components/auth/organization/slug-field.tsx +111 -0
- package/src/components/auth/organization/user-invitation-row-skeleton.tsx +17 -0
- package/src/components/auth/organization/user-invitation-row.tsx +90 -0
- package/src/components/auth/organization/user-invitations-empty.tsx +30 -0
- package/src/components/auth/organization/user-invitations.tsx +59 -0
- package/src/components/auth/passkey/add-passkey-dialog.tsx +109 -0
- package/src/components/auth/passkey/delete-passkey-dialog.tsx +95 -0
- package/src/components/auth/passkey/passkey-skeleton.tsx +16 -0
- package/src/components/auth/passkey/passkey.tsx +23 -22
- package/src/components/auth/passkey/passkeys-empty.tsx +35 -0
- package/src/components/auth/passkey/passkeys.tsx +33 -154
- package/src/components/auth/settings/account/change-email.tsx +1 -1
- package/src/components/auth/settings/account/user-profile.tsx +5 -5
- package/src/components/auth/settings/security/active-sessions.tsx +6 -4
- package/src/components/auth/settings/security/linked-accounts.tsx +2 -2
- package/src/components/auth/settings/settings.tsx +77 -14
- package/src/components/auth/user/user-avatar.tsx +4 -1
- package/src/components/auth/user/user-button.tsx +14 -11
- package/src/components/auth/user/user-view.tsx +32 -12
- package/src/email.ts +1 -0
- package/src/lib/auth/api-key-plugin.ts +10 -4
- package/src/lib/auth/auth-plugin.ts +6 -1
- package/src/lib/auth/organization-plugin.tsx +32 -0
- package/src/plugins.ts +25 -1
- package/dist/components/auth/delete-user/delete-user.d.ts +0 -9
- package/dist/components/auth/delete-user/delete-user.js +0 -95
|
@@ -1,89 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fileToBase64
|
|
3
|
-
import { useAuth
|
|
4
|
-
import { CloudArrowUpIn
|
|
5
|
-
import { Button
|
|
6
|
-
import { useRef
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
children: [/* @__PURE__ */ h(s, {
|
|
55
|
-
type: "button",
|
|
56
|
-
isIconOnly: !0,
|
|
57
|
-
variant: "ghost",
|
|
58
|
-
className: "p-0 h-auto w-auto rounded-full",
|
|
59
|
-
isDisabled: !x || k,
|
|
60
|
-
onPress: () => w.current?.click(),
|
|
61
|
-
children: /* @__PURE__ */ h(e, {
|
|
62
|
-
size: "lg",
|
|
63
|
-
isPending: k
|
|
64
|
-
})
|
|
65
|
-
}), /* @__PURE__ */ g(c, { children: [/* @__PURE__ */ g(s, {
|
|
66
|
-
isDisabled: !x || k,
|
|
67
|
-
size: "sm",
|
|
68
|
-
variant: "secondary",
|
|
69
|
-
children: [k && /* @__PURE__ */ h(u, { size: "sm" }), y.settings.changeAvatar]
|
|
70
|
-
}), /* @__PURE__ */ h(c.Popover, {
|
|
71
|
-
className: "min-w-fit",
|
|
72
|
-
children: /* @__PURE__ */ g(c.Menu, { children: [/* @__PURE__ */ g(c.Item, {
|
|
73
|
-
textValue: y.settings.uploadAvatar,
|
|
74
|
-
onAction: () => w.current?.click(),
|
|
75
|
-
children: [/* @__PURE__ */ h(a, { className: "text-muted" }), /* @__PURE__ */ h(l, { children: y.settings.uploadAvatar })]
|
|
76
|
-
}), /* @__PURE__ */ g(c.Item, {
|
|
77
|
-
textValue: y.settings.deleteAvatar,
|
|
78
|
-
isDisabled: !x?.user.image,
|
|
79
|
-
onAction: j,
|
|
80
|
-
variant: "danger",
|
|
81
|
-
children: [/* @__PURE__ */ h(o, { className: "text-danger" }), /* @__PURE__ */ h(l, { children: y.settings.deleteAvatar })]
|
|
82
|
-
})] })
|
|
83
|
-
})] })]
|
|
84
|
-
})
|
|
85
|
-
]
|
|
86
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { fileToBase64 } from "@better-auth-ui/core";
|
|
3
|
+
import { useAuth, useSession, useUpdateUser } from "@better-auth-ui/react";
|
|
4
|
+
import { CloudArrowUpIn, TrashBin } from "@gravity-ui/icons";
|
|
5
|
+
import { Button, cn, Dropdown, Label, Spinner, toast } from "@heroui/react";
|
|
6
|
+
import { useRef, useState } from "react";
|
|
7
|
+
import { UserAvatar } from "../../user/user-avatar";
|
|
8
|
+
export function ChangeAvatar({ className }) {
|
|
9
|
+
const { authClient, localization, avatar } = useAuth();
|
|
10
|
+
const { data: session } = useSession(authClient);
|
|
11
|
+
const { mutate: updateUser, isPending: updatePending } = useUpdateUser(authClient);
|
|
12
|
+
const fileInputRef = useRef(null);
|
|
13
|
+
const [isUploading, setIsUploading] = useState(false);
|
|
14
|
+
const [isDeleting, setIsDeleting] = useState(false);
|
|
15
|
+
const isPending = updatePending || isUploading || isDeleting;
|
|
16
|
+
async function handleFileChange(e) {
|
|
17
|
+
const file = e.target.files?.[0];
|
|
18
|
+
if (!file)
|
|
19
|
+
return;
|
|
20
|
+
e.target.value = "";
|
|
21
|
+
setIsUploading(true);
|
|
22
|
+
try {
|
|
23
|
+
const resized = (await avatar.resize?.(file, avatar.size, avatar.extension)) || file;
|
|
24
|
+
const image = (await avatar.upload?.(resized)) || (await fileToBase64(resized));
|
|
25
|
+
updateUser({ image }, {
|
|
26
|
+
onSuccess: () => toast.success(localization.settings.avatarChangedSuccess)
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error instanceof Error) {
|
|
31
|
+
toast.danger(error.message);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
setIsUploading(false);
|
|
35
|
+
}
|
|
36
|
+
async function handleDelete() {
|
|
37
|
+
const currentImage = session?.user.image;
|
|
38
|
+
updateUser({ image: null }, {
|
|
39
|
+
onSuccess: async () => {
|
|
40
|
+
if (currentImage) {
|
|
41
|
+
setIsDeleting(true);
|
|
42
|
+
try {
|
|
43
|
+
await avatar.delete?.(currentImage);
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
setIsDeleting(false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
toast.success(localization.settings.avatarDeletedSuccess);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-1", className), children: [_jsx(Label, { isDisabled: !session, children: localization.settings.avatar }), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handleFileChange }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsx(Button, { type: "button", isIconOnly: true, variant: "ghost", className: "p-0 h-auto w-auto rounded-full", isDisabled: !session || isPending, onPress: () => fileInputRef.current?.click(), children: _jsx(UserAvatar, { size: "lg", isPending: isPending }) }), _jsxs(Dropdown, { children: [_jsxs(Button, { isDisabled: !session || isPending, size: "sm", variant: "secondary", children: [isPending && _jsx(Spinner, { size: "sm" }), localization.settings.changeAvatar] }), _jsx(Dropdown.Popover, { className: "min-w-fit", children: _jsxs(Dropdown.Menu, { children: [_jsxs(Dropdown.Item, { textValue: localization.settings.uploadAvatar, onAction: () => fileInputRef.current?.click(), children: [_jsx(CloudArrowUpIn, { className: "text-muted" }), _jsx(Label, { children: localization.settings.uploadAvatar })] }), _jsxs(Dropdown.Item, { textValue: localization.settings.deleteAvatar, isDisabled: !session?.user.image, onAction: handleDelete, variant: "danger", children: [_jsx(TrashBin, { className: "text-danger" }), _jsx(Label, { children: localization.settings.deleteAvatar })] })] }) })] })] })] }));
|
|
87
54
|
}
|
|
88
|
-
//#endregion
|
|
89
|
-
export { _ as ChangeAvatar };
|
|
@@ -1,54 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
isDisabled: E || !w,
|
|
29
|
-
children: [
|
|
30
|
-
/* @__PURE__ */ h(l, { children: x.auth.email }),
|
|
31
|
-
w ? /* @__PURE__ */ h(c, {
|
|
32
|
-
required: !0,
|
|
33
|
-
variant: v === "transparent" ? "primary" : "secondary",
|
|
34
|
-
autoComplete: "email",
|
|
35
|
-
placeholder: x.auth.emailPlaceholder
|
|
36
|
-
}) : /* @__PURE__ */ h(u, { className: "h-10 md:h-9 w-full rounded-xl" }),
|
|
37
|
-
/* @__PURE__ */ h(a, {})
|
|
38
|
-
]
|
|
39
|
-
}, w?.user.email) }), /* @__PURE__ */ h(o.Actions, { children: /* @__PURE__ */ g(r, {
|
|
40
|
-
type: "submit",
|
|
41
|
-
isPending: E,
|
|
42
|
-
isDisabled: !w,
|
|
43
|
-
size: "sm",
|
|
44
|
-
children: [E && /* @__PURE__ */ h(d, {
|
|
45
|
-
color: "current",
|
|
46
|
-
size: "sm"
|
|
47
|
-
}), x.settings.updateEmail]
|
|
48
|
-
}) })]
|
|
49
|
-
})
|
|
50
|
-
}) })
|
|
51
|
-
})] });
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAuth, useChangeEmail, useSession } from "@better-auth-ui/react";
|
|
3
|
+
import { Button, Card, cn, FieldError, Fieldset, Form, Input, Label, Skeleton, Spinner, TextField, toast } from "@heroui/react";
|
|
4
|
+
/**
|
|
5
|
+
* Render a card containing a form to view and update the authenticated user's email.
|
|
6
|
+
*
|
|
7
|
+
* Shows a loading skeleton until session data is available, displays the current
|
|
8
|
+
* email as the form's default value, and sends a verification email to the
|
|
9
|
+
* new address upon successful submission.
|
|
10
|
+
*
|
|
11
|
+
* @returns A JSX element rendering the change-email card and form
|
|
12
|
+
*/
|
|
13
|
+
export function ChangeEmail({ className, variant, ...props }) {
|
|
14
|
+
const { authClient, localization, baseURL, viewPaths } = useAuth();
|
|
15
|
+
const { data: session } = useSession(authClient);
|
|
16
|
+
const { mutate: changeEmail, isPending } = useChangeEmail(authClient, {
|
|
17
|
+
onSuccess: () => toast.success(localization.settings.changeEmailSuccess)
|
|
18
|
+
});
|
|
19
|
+
function handleSubmit(e) {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
const formData = new FormData(e.currentTarget);
|
|
22
|
+
changeEmail({
|
|
23
|
+
newEmail: formData.get("email"),
|
|
24
|
+
callbackURL: `${baseURL}/${viewPaths.settings.account}`
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: cn("text-sm font-semibold mb-3"), children: localization.settings.changeEmail }), _jsx(Card, { className: cn("p-4 gap-4", className), variant: variant, ...props, children: _jsx(Card.Content, { children: _jsx(Form, { onSubmit: handleSubmit, children: _jsxs(Fieldset, { className: "w-full gap-4", children: [_jsx(Fieldset.Group, { children: _jsxs(TextField, { name: "email", type: "email", defaultValue: session?.user.email, isDisabled: isPending || !session, children: [_jsx(Label, { children: localization.auth.email }), session ? (_jsx(Input, { required: true, variant: variant === "transparent" ? "primary" : "secondary", autoComplete: "email", placeholder: localization.auth.emailPlaceholder })) : (_jsx(Skeleton, { className: "h-10 md:h-9 w-full rounded-xl" })), _jsx(FieldError, {})] }, `${session?.user.id}-${session?.user.email}-email`) }), _jsx(Fieldset.Actions, { children: _jsxs(Button, { type: "submit", isPending: isPending, isDisabled: !session, size: "sm", children: [isPending && _jsx(Spinner, { color: "current", size: "sm" }), localization.settings.updateEmail] }) })] }) }) }) })] }));
|
|
52
28
|
}
|
|
53
|
-
//#endregion
|
|
54
|
-
export { _ as ChangeEmail };
|
|
@@ -1,86 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
isPending: D,
|
|
67
|
-
variant: b
|
|
68
|
-
}, r);
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ v(o, {
|
|
71
|
-
type: "submit",
|
|
72
|
-
isPending: D,
|
|
73
|
-
isDisabled: !T,
|
|
74
|
-
size: "sm",
|
|
75
|
-
className: "self-start mt-1",
|
|
76
|
-
children: [D && /* @__PURE__ */ _(p, {
|
|
77
|
-
color: "current",
|
|
78
|
-
size: "sm"
|
|
79
|
-
}), w.settings.saveChanges]
|
|
80
|
-
})
|
|
81
|
-
]
|
|
82
|
-
}) })
|
|
83
|
-
})] });
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { parseAdditionalFieldValue } from "@better-auth-ui/core";
|
|
3
|
+
import { useAuth, useSession, useUpdateUser } from "@better-auth-ui/react";
|
|
4
|
+
import { Button, Card, cn, FieldError, Form, Input, Label, Skeleton, Spinner, TextField, toast } from "@heroui/react";
|
|
5
|
+
import { AdditionalField } from "../../additional-field";
|
|
6
|
+
import { ChangeAvatar } from "./change-avatar";
|
|
7
|
+
/**
|
|
8
|
+
* Render a profile card that lets the authenticated user view and update their
|
|
9
|
+
* display name, avatar, and any plugin- or user-supplied additional fields.
|
|
10
|
+
*/
|
|
11
|
+
export function UserProfile({ className, variant, ...props }) {
|
|
12
|
+
const { additionalFields, authClient, localization } = useAuth();
|
|
13
|
+
const { data: session } = useSession(authClient);
|
|
14
|
+
const { mutate: updateUser, isPending } = useUpdateUser(authClient, {
|
|
15
|
+
onSuccess: () => toast.success(localization.settings.profileUpdatedSuccess)
|
|
16
|
+
});
|
|
17
|
+
async function handleSubmit(e) {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
const formData = new FormData(e.currentTarget);
|
|
20
|
+
const name = formData.get("name");
|
|
21
|
+
const additionalFieldValues = {};
|
|
22
|
+
for (const field of additionalFields ?? []) {
|
|
23
|
+
if (field.profile === false || field.readOnly)
|
|
24
|
+
continue;
|
|
25
|
+
const value = parseAdditionalFieldValue(field, formData.get(field.name));
|
|
26
|
+
if (field.validate) {
|
|
27
|
+
try {
|
|
28
|
+
await field.validate(value);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
toast.danger(error instanceof Error ? error.message : String(error));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// `null` = explicit clear (forward to backend); `undefined` = omitted.
|
|
36
|
+
if (value !== undefined) {
|
|
37
|
+
additionalFieldValues[field.name] = value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
updateUser({
|
|
41
|
+
name,
|
|
42
|
+
...additionalFieldValues
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: cn("text-sm font-semibold mb-3"), children: localization.settings.userProfile }), _jsx(Card, { className: cn("p-4 gap-4", className), variant: variant, ...props, children: _jsx(Card.Content, { children: _jsxs(Form, { onSubmit: handleSubmit, className: "flex flex-col gap-4", children: [_jsx(ChangeAvatar, {}), _jsxs(TextField, { name: "name", defaultValue: session?.user.name, isDisabled: isPending || !session, children: [_jsx(Label, { children: localization.auth.name }), _jsx(Input, { className: cn(!session && "hidden"), autoComplete: "name", placeholder: localization.auth.name, variant: variant === "transparent" ? "primary" : "secondary" }), !session && (_jsx(Skeleton, { className: "h-10 md:h-9 w-full rounded-xl" })), _jsx(FieldError, {})] }, `${session?.user?.id}-${session?.user?.name}-name`), additionalFields
|
|
46
|
+
?.filter((field) => field.profile !== false)
|
|
47
|
+
.map((field) => {
|
|
48
|
+
if (!session) {
|
|
49
|
+
if (field.inputType === "hidden") {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return (_jsx(Skeleton, { className: "h-10 md:h-9 w-full rounded-xl" }, field.name));
|
|
53
|
+
}
|
|
54
|
+
const value = session.user[field.name];
|
|
55
|
+
// Re-mount when the user or the session value changes so the
|
|
56
|
+
// field's uncontrolled `defaultValue` reflects the latest data.
|
|
57
|
+
const key = `${session.user.id}-${field.name}-${value instanceof Date
|
|
58
|
+
? value.toISOString()
|
|
59
|
+
: String(value ?? "")}`;
|
|
60
|
+
return (_jsx(AdditionalField, { name: field.name, field: {
|
|
61
|
+
...field,
|
|
62
|
+
defaultValue: value
|
|
63
|
+
}, isPending: isPending, variant: variant }, key));
|
|
64
|
+
}), _jsxs(Button, { type: "submit", isPending: isPending, isDisabled: !session, size: "sm", className: "self-start mt-1", children: [isPending && _jsx(Spinner, { color: "current", size: "sm" }), localization.settings.saveChanges] })] }) }) })] }));
|
|
84
65
|
}
|
|
85
|
-
//#endregion
|
|
86
|
-
export { y as UserProfile };
|
|
@@ -1,59 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAuth, useRevokeSession, useSession } from "@better-auth-ui/react";
|
|
3
|
+
import { ArrowRightFromSquare, Display, Smartphone, Xmark } from "@gravity-ui/icons";
|
|
4
|
+
import { Button, Chip, Spinner, toast } from "@heroui/react";
|
|
5
|
+
import Bowser from "bowser";
|
|
6
|
+
function timeAgo(date) {
|
|
7
|
+
const seconds = Math.floor((Date.now() - date.getTime()) / 1000);
|
|
8
|
+
const rtf = new Intl.RelativeTimeFormat(undefined, { numeric: "auto" });
|
|
9
|
+
const UNITS = [
|
|
10
|
+
["year", 31536000],
|
|
11
|
+
["month", 2592000],
|
|
12
|
+
["week", 604800],
|
|
13
|
+
["day", 86400],
|
|
14
|
+
["hour", 3600],
|
|
15
|
+
["minute", 60],
|
|
16
|
+
["second", 1]
|
|
17
|
+
];
|
|
18
|
+
for (const [unit, threshold] of UNITS) {
|
|
19
|
+
if (seconds >= threshold) {
|
|
20
|
+
return rtf.format(-Math.floor(seconds / threshold), unit);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return rtf.format(0, "second");
|
|
19
24
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
onPress: () => w ? b({ to: `${_.auth}/${y.auth.signOut}` }) : S(h),
|
|
48
|
-
isPending: C,
|
|
49
|
-
"aria-label": w ? v.auth.signOut : v.settings.revokeSession,
|
|
50
|
-
children: [C ? /* @__PURE__ */ d(l, {
|
|
51
|
-
color: "current",
|
|
52
|
-
size: "sm"
|
|
53
|
-
}) : d(w ? r : o, {}), w ? v.auth.signOut : v.settings.revoke]
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
});
|
|
25
|
+
/**
|
|
26
|
+
* Render a single active session row with device info and revoke control.
|
|
27
|
+
*
|
|
28
|
+
* Shows the session's browser, OS, IP address, and creation time. The current session is marked
|
|
29
|
+
* and navigates to sign-out on click, while other sessions can be revoked individually.
|
|
30
|
+
*
|
|
31
|
+
* @param session - The session object containing id, token, userAgent, ipAddress, and createdAt
|
|
32
|
+
* @returns A JSX element containing the active session row
|
|
33
|
+
*/
|
|
34
|
+
export function ActiveSession({ activeSession }) {
|
|
35
|
+
const { authClient, basePaths, localization, viewPaths, navigate } = useAuth();
|
|
36
|
+
const { data: session } = useSession(authClient, { refetchOnMount: false });
|
|
37
|
+
const { mutate: revokeSession, isPending: isRevoking } = useRevokeSession(authClient, {
|
|
38
|
+
onSuccess: () => toast.success(localization.settings.revokeSessionSuccess)
|
|
39
|
+
});
|
|
40
|
+
const isCurrentSession = activeSession.token === session?.session.token;
|
|
41
|
+
const ua = Bowser.parse(activeSession.userAgent || "");
|
|
42
|
+
const isMobile = ua.platform.type === "mobile" || ua.platform.type === "tablet";
|
|
43
|
+
return (_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary", children: isMobile ? (_jsx(Smartphone, { className: "size-4.5" })) : (_jsx(Display, { className: "size-4.5" })) }), _jsxs("div", { className: "flex flex-col min-w-0", children: [_jsxs("span", { className: "text-sm font-medium truncate", children: [ua.browser.name || "Unknown Browser", ua.os.name ? `, ${ua.os.name}` : ""] }), isCurrentSession ? (_jsx(Chip, { color: "accent", size: "sm", children: localization.settings.currentSession })) : (activeSession.createdAt && (_jsx("span", { className: "text-xs text-muted capitalize", children: timeAgo(activeSession.createdAt) })))] }), _jsxs(Button, { className: "ml-auto shrink-0", variant: "outline", size: "sm", onPress: () => isCurrentSession
|
|
44
|
+
? navigate({
|
|
45
|
+
to: `${basePaths.auth}/${viewPaths.auth.signOut}`
|
|
46
|
+
})
|
|
47
|
+
: revokeSession(activeSession), isPending: isRevoking, "aria-label": isCurrentSession
|
|
48
|
+
? localization.auth.signOut
|
|
49
|
+
: localization.settings.revokeSession, children: [isRevoking ? (_jsx(Spinner, { color: "current", size: "sm" })) : isCurrentSession ? (_jsx(ArrowRightFromSquare, {})) : (_jsx(Xmark, {})), isCurrentSession
|
|
50
|
+
? localization.auth.signOut
|
|
51
|
+
: localization.settings.revoke] })] }));
|
|
57
52
|
}
|
|
58
|
-
//#endregion
|
|
59
|
-
export { h as ActiveSession };
|
|
@@ -1,34 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useAuth
|
|
3
|
-
import { Card
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAuth, useListSessions, useSession } from "@better-auth-ui/react";
|
|
3
|
+
import { Card, cn, Skeleton } from "@heroui/react";
|
|
4
|
+
import { ActiveSession } from "./active-session";
|
|
5
|
+
/**
|
|
6
|
+
* Render a card listing all active sessions for the current user with revoke controls.
|
|
7
|
+
*
|
|
8
|
+
* Shows each session's browser, OS, IP address, and creation time. The current session is marked
|
|
9
|
+
* and navigates to sign-out on click, while other sessions can be revoked individually.
|
|
10
|
+
*
|
|
11
|
+
* @returns A JSX element containing the sessions card
|
|
12
|
+
*/
|
|
13
|
+
export function ActiveSessions({ className, variant, ...props }) {
|
|
14
|
+
const { authClient, localization } = useAuth();
|
|
15
|
+
const { data: session } = useSession(authClient);
|
|
16
|
+
const { data: sessions, isPending } = useListSessions(authClient);
|
|
17
|
+
const activeSessions = sessions &&
|
|
18
|
+
[...sessions].sort((a, b) => a.id === session?.session.id ? -1 : b.id === session?.session.id ? 1 : 0);
|
|
19
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: cn("text-sm font-semibold mb-3"), children: localization.settings.activeSessions }), _jsx(Card, { className: cn(className), variant: variant, ...props, children: _jsx(Card.Content, { className: "gap-0", children: isPending ? (_jsx(SessionRowSkeleton, {})) : (activeSessions?.map((activeSession, index) => (_jsxs("div", { children: [index > 0 && (_jsx("div", { className: "border-b border-dashed -mx-4 my-4" })), _jsx(ActiveSession, { activeSession: activeSession })] }, activeSession.id)))) }) })] }));
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
className: "flex items-center justify-between",
|
|
24
|
-
children: /* @__PURE__ */ c("div", {
|
|
25
|
-
className: "flex items-center gap-3",
|
|
26
|
-
children: [/* @__PURE__ */ s(a, { className: "size-10 rounded-xl" }), /* @__PURE__ */ c("div", {
|
|
27
|
-
className: "flex flex-col gap-1",
|
|
28
|
-
children: [/* @__PURE__ */ s(a, { className: "h-4 w-32 rounded-lg" }), /* @__PURE__ */ s(a, { className: "h-3 w-24 rounded-lg" })]
|
|
29
|
-
})]
|
|
30
|
-
})
|
|
31
|
-
});
|
|
21
|
+
function SessionRowSkeleton() {
|
|
22
|
+
return (_jsx("div", { className: "flex items-center justify-between", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Skeleton, { className: "size-10 rounded-xl" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Skeleton, { className: "h-4 w-32 rounded-lg" }), _jsx(Skeleton, { className: "h-3 w-24 rounded-lg" })] })] }) }));
|
|
32
23
|
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { l as ActiveSessions };
|