@xk2800/nextjs-template 0.7.2-beta.2 → 0.7.2-beta.4
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/components/auth/{loginErrorRecovery.tsx → forms/login-error-recovery.tsx} +1 -1
- package/components/auth/{emailPasswordLogin.tsx → forms/login-form.tsx} +8 -8
- package/components/auth/{emailPasswordSignup.tsx → forms/signup-form.tsx} +8 -8
- package/components/auth/{authCard.tsx → layout/auth-card.tsx} +5 -5
- package/components/auth/{authShell.tsx → layout/auth-shell.tsx} +17 -5
- package/components/auth/{oneTap.tsx → methods/one-tap.tsx} +2 -2
- package/components/auth/{passkeyLogin.tsx → methods/passkey-login.tsx} +2 -2
- package/components/auth/{socialLogin.tsx → methods/social-login.tsx} +3 -3
- package/components/auth/{twoFactorVerifyForm.tsx → mfa/two-factor-verify-form.tsx} +5 -5
- package/components/auth/{forgotPasswordForm.tsx → recovery/forgot-password-form.tsx} +4 -4
- package/components/auth/{resetPasswordForm.tsx → recovery/reset-password-form.tsx} +4 -4
- package/components/auth/{deviceCheck.tsx → session/device-check.tsx} +3 -3
- package/components/auth/{logoutButtons.tsx → session/logout-buttons.tsx} +2 -2
- package/components/dashboard/admin/{activityLogsSection.tsx → activity-logs/activity-logs-section.tsx} +1 -1
- package/components/dashboard/admin/activity-logs/admin-activity-logs-table.tsx +375 -0
- package/components/dashboard/admin/activity-logs/audit-severity-badge.tsx +50 -0
- package/components/dashboard/admin/activity-logs/security-highlights-collapsible.tsx +129 -0
- package/components/dashboard/admin/{adminActivityLogsSkeleton.tsx → activity-logs/skeletons/activity-logs-skeleton.tsx} +2 -2
- package/components/dashboard/admin/{adminStatsGrid.tsx → home/admin-stats-grid.tsx} +1 -1
- package/components/dashboard/admin/{deviceThrottleCard.tsx → home/device-throttle-card.tsx} +8 -5
- package/components/dashboard/admin/{deviceThrottleTable.tsx → home/device-throttle-table.tsx} +3 -3
- package/components/dashboard/admin/{newDeviceCard.tsx → home/new-device-card.tsx} +6 -2
- package/components/dashboard/admin/{newDeviceTable.tsx → home/new-device-table.tsx} +4 -4
- package/components/dashboard/admin/{sharedDeviceCard.tsx → home/shared-device-card.tsx} +3 -3
- package/components/dashboard/admin/{sharedDeviceTable.tsx → home/shared-device-table.tsx} +3 -3
- package/components/dashboard/admin/{adminStatsGridSkeleton.tsx → home/skeletons/admin-stats-skeleton.tsx} +2 -2
- package/components/dashboard/admin/{broadcastActions.tsx → marketing/broadcast-actions.tsx} +3 -3
- package/components/dashboard/admin/{confirmSendDialog.tsx → marketing/confirm-send-dialog.tsx} +1 -1
- package/components/dashboard/admin/{marketingEmailForm.tsx → marketing/marketing-email-form.tsx} +7 -7
- package/components/dashboard/admin/{marketingSection.tsx → marketing/marketing-section.tsx} +6 -6
- package/components/dashboard/admin/{subscribersCard.tsx → marketing/subscribers-card.tsx} +3 -3
- package/components/dashboard/admin/{feedbackTestForm.tsx → system-settings/feedback-test-form.tsx} +4 -4
- package/components/dashboard/admin/{systemSettingsSkeleton.tsx → system-settings/skeletons/system-settings-skeleton.tsx} +2 -2
- package/components/dashboard/admin/system-settings/system-settings-form.tsx +362 -0
- package/components/dashboard/admin/{systemSettingsSection.tsx → system-settings/system-settings-section.tsx} +3 -2
- package/components/dashboard/admin/users/admin-user-actions.tsx +238 -0
- package/components/dashboard/admin/users/admin-user-profile-card.tsx +70 -0
- package/components/dashboard/admin/users/admin-user-security-card.tsx +47 -0
- package/components/dashboard/admin/users/admin-user-status-card.tsx +89 -0
- package/components/dashboard/admin/{adminUsersTable.tsx → users/admin-users-table.tsx} +129 -132
- package/components/dashboard/admin/{adminUserActivityLogCard.tsx → users/detail/admin-user-activity-log-card.tsx} +3 -3
- package/components/dashboard/admin/{adminUserActivityLogTable.tsx → users/detail/admin-user-activity-log-table.tsx} +3 -3
- package/components/dashboard/admin/{adminUserConsentCard.tsx → users/detail/admin-user-consent-card.tsx} +4 -4
- package/components/dashboard/admin/{adminUserDevicesCard.tsx → users/detail/admin-user-devices-card.tsx} +2 -2
- package/components/dashboard/admin/{adminUserLoginInfoCard.tsx → users/detail/admin-user-login-info-card.tsx} +3 -3
- package/components/dashboard/admin/{adminUserLoginInfoTable.tsx → users/detail/admin-user-login-info-table.tsx} +3 -3
- package/components/dashboard/admin/{adminUserSessionsCard.tsx → users/detail/admin-user-sessions-card.tsx} +5 -5
- package/components/dashboard/admin/{impersonationLogCard.tsx → users/impersonation-log-card.tsx} +10 -5
- package/components/dashboard/admin/users/impersonation-tab.tsx +255 -0
- package/components/dashboard/admin/users/invite-user-dialog.tsx +80 -0
- package/components/dashboard/admin/{revokeAllSessionsButton.tsx → users/revoke-all-sessions.tsx} +5 -3
- package/components/dashboard/admin/{adminUsersSkeleton.tsx → users/skeletons/admin-users-skeleton.tsx} +2 -2
- package/components/dashboard/admin/{usersSection.tsx → users/users-section.tsx} +1 -1
- package/components/dashboard/{errorFeedback.tsx → common/error-feedback.tsx} +1 -1
- package/components/dashboard/{feedbackDialog.tsx → common/feedback-dialog.tsx} +4 -4
- package/components/dashboard/{sectionErrorFallback.tsx → common/section-error-fallback.tsx} +1 -1
- package/components/dashboard/{verifyEmailButton.tsx → common/verify-email-button.tsx} +2 -2
- package/components/dashboard/{appSidebar.tsx → layout/app-sidebar.tsx} +4 -6
- package/components/dashboard/{dashboardHeader.tsx → layout/dashboard-header.tsx} +1 -1
- package/components/dashboard/{impersonationBanner.tsx → layout/impersonation-banner.tsx} +2 -2
- package/components/dashboard/{navStyleToggle.tsx → layout/nav-style-toggle.tsx} +1 -1
- package/components/dashboard/{topNav.tsx → layout/top-nav.tsx} +5 -5
- package/components/dashboard/{installAppCard.tsx → overview/install-app-card.tsx} +2 -2
- package/components/dashboard/{accountDetailsCard.tsx → settings/account-details-card.tsx} +5 -5
- package/components/dashboard/{activityLogsCard.tsx → settings/activity-logs-card.tsx} +5 -5
- package/components/dashboard/{activityLogsSection.tsx → settings/activity-logs-section.tsx} +1 -1
- package/components/dashboard/{adminSection.tsx → settings/admin-section.tsx} +2 -2
- package/components/dashboard/{deleteAccountCard.tsx → settings/delete-account-card.tsx} +7 -7
- package/components/dashboard/{marketingUpdatesCard.tsx → settings/marketing-updates-card.tsx} +3 -3
- package/components/dashboard/{marketingUpdatesSection.tsx → settings/marketing-updates-section.tsx} +1 -1
- package/components/dashboard/{passkeysCard.tsx → settings/passkeys-card.tsx} +8 -8
- package/components/dashboard/{profileCard.tsx → settings/profile-card.tsx} +4 -4
- package/components/dashboard/{sessionsCard.tsx → settings/sessions/sessions-card.tsx} +6 -6
- package/components/dashboard/{sessionsSection.tsx → settings/sessions/sessions-section.tsx} +1 -1
- package/components/dashboard/{sessionsCardSkeleton.tsx → settings/sessions/skeletons/sessions-card-skeleton.tsx} +2 -2
- package/components/dashboard/{activityLogsCardSkeleton.tsx → settings/skeletons/activity-logs-card-skeleton.tsx} +2 -2
- package/components/dashboard/{twoFactorCard.tsx → settings/two-factor-card.tsx} +8 -8
- package/components/email/team/workspace-invite.tsx +51 -0
- package/components/email/{send-email-button.tsx → ui/send-email-button.tsx} +1 -1
- package/components/error-boundary.tsx +32 -0
- package/components/settings/appearance/appearance-section.tsx +64 -0
- package/components/settings/index.ts +5 -0
- package/components/settings/notifications/notifications-section.tsx +31 -0
- package/components/settings/profile/profile-section.tsx +38 -0
- package/components/settings/security/security-section.tsx +24 -0
- package/components/settings/settings-nav.tsx +35 -0
- package/components/site/{cookie-banner.tsx → compliance/cookie-banner.tsx} +6 -6
- package/components/site/push/push-notifications-card.tsx +117 -0
- package/components/ui/collapsible.tsx +9 -0
- package/components/ui/column-picker.tsx +1 -1
- package/components/ui/data-table.tsx +1 -1
- package/components/ui/tabs.tsx +52 -0
- package/dist/activity/logger.js +2 -2
- package/dist/activity/logger.js.map +1 -1
- package/dist/activity/logger.mjs +3 -3
- package/dist/activity/queries.d.mts +7 -3
- package/dist/activity/queries.d.ts +7 -3
- package/dist/activity/queries.js +16 -5
- package/dist/activity/queries.js.map +1 -1
- package/dist/activity/queries.mjs +18 -7
- package/dist/activity/queries.mjs.map +1 -1
- package/dist/admin/queries.js +4 -4
- package/dist/admin/queries.js.map +1 -1
- package/dist/admin/queries.mjs +5 -5
- package/dist/admin/queries.mjs.map +1 -1
- package/dist/api/feedback.js +25 -24
- package/dist/api/feedback.js.map +1 -1
- package/dist/api/feedback.mjs +8 -8
- package/dist/api/feedback.mjs.map +1 -1
- package/dist/api/marketing.js +28 -27
- package/dist/api/marketing.js.map +1 -1
- package/dist/api/marketing.mjs +12 -12
- package/dist/api/marketing.mjs.map +1 -1
- package/dist/auth/helpers.d.mts +22 -22
- package/dist/auth/helpers.d.ts +22 -22
- package/dist/auth/helpers.js +26 -25
- package/dist/auth/helpers.js.map +1 -1
- package/dist/auth/helpers.mjs +8 -8
- package/dist/auth/index.js +24 -23
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/index.mjs +7 -7
- package/dist/auth-client/index.js +1 -1
- package/dist/auth-client/index.js.map +1 -1
- package/dist/auth-client/index.mjs.map +1 -1
- package/dist/{chunk-VVXYKVFJ.mjs → chunk-2BKXG4MG.mjs} +8 -7
- package/dist/chunk-2BKXG4MG.mjs.map +1 -0
- package/dist/{chunk-653GF7OT.mjs → chunk-AOSJUQQG.mjs} +4 -4
- package/dist/chunk-AOSJUQQG.mjs.map +1 -0
- package/dist/{chunk-L242CZ64.mjs → chunk-CRDC62BU.mjs} +2 -2
- package/dist/chunk-CRDC62BU.mjs.map +1 -0
- package/dist/{chunk-NQELV53D.mjs → chunk-J5XRJ2GW.mjs} +3 -3
- package/dist/chunk-J5XRJ2GW.mjs.map +1 -0
- package/dist/{chunk-6OAHCEDJ.mjs → chunk-JRDMU6I2.mjs} +4 -4
- package/dist/chunk-JRDMU6I2.mjs.map +1 -0
- package/dist/{chunk-O5EQYHNC.mjs → chunk-JSB36AY6.mjs} +4 -4
- package/dist/chunk-JSB36AY6.mjs.map +1 -0
- package/dist/{chunk-TE5BEAQB.mjs → chunk-M6Y2XNJC.mjs} +3 -3
- package/dist/chunk-M6Y2XNJC.mjs.map +1 -0
- package/dist/{chunk-K2GCSLRJ.mjs → chunk-NOFQCVHC.mjs} +14 -13
- package/dist/chunk-NOFQCVHC.mjs.map +1 -0
- package/dist/{chunk-K62JYJRR.mjs → chunk-RLZ7F7ZY.mjs} +3 -3
- package/dist/{chunk-K62JYJRR.mjs.map → chunk-RLZ7F7ZY.mjs.map} +1 -1
- package/dist/{chunk-2BJ3B4FR.mjs → chunk-TMANA7KL.mjs} +41 -5
- package/dist/chunk-TMANA7KL.mjs.map +1 -0
- package/dist/db/index.js +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/db/index.mjs +2 -2
- package/dist/db/schema.js +1 -1
- package/dist/db/schema.js.map +1 -1
- package/dist/db/schema.mjs +1 -1
- package/dist/errors.js +2 -2
- package/dist/errors.js.map +1 -1
- package/dist/errors.mjs +3 -3
- package/dist/marketing/index.js +2 -2
- package/dist/marketing/index.js.map +1 -1
- package/dist/marketing/index.mjs +2 -2
- package/dist/{email-template-passkey-change-F5Q2SXHD.mjs → passkey-changed-KEGNTIPE.mjs} +2 -2
- package/dist/passkey-changed-KEGNTIPE.mjs.map +1 -0
- package/dist/{email-template-reset-password-QTCQNXOD.mjs → reset-password-64VQEXBW.mjs} +2 -2
- package/dist/reset-password-64VQEXBW.mjs.map +1 -0
- package/dist/sessions/queries.js +1 -1
- package/dist/sessions/queries.js.map +1 -1
- package/dist/sessions/queries.mjs +2 -2
- package/dist/sessions/queries.mjs.map +1 -1
- package/dist/settings/queries.d.mts +9 -1
- package/dist/settings/queries.d.ts +9 -1
- package/dist/settings/queries.js +38 -1
- package/dist/settings/queries.js.map +1 -1
- package/dist/settings/queries.mjs +3 -3
- package/dist/users/queries.d.mts +18 -3
- package/dist/users/queries.d.ts +18 -3
- package/dist/users/queries.js +70 -11
- package/dist/users/queries.js.map +1 -1
- package/dist/users/queries.mjs +53 -15
- package/dist/users/queries.mjs.map +1 -1
- package/dist/{email-template-verify-email-WZDCCAKK.mjs → verify-email-4KMNGDKN.mjs} +2 -2
- package/dist/verify-email-4KMNGDKN.mjs.map +1 -0
- package/lib/push/client.ts +39 -0
- package/lib/security/activity-severity.ts +57 -0
- package/package.json +113 -18
- package/components/dashboard/admin/adminActivityLogsTable.tsx +0 -323
- package/components/dashboard/admin/adminUserStatusCard.tsx +0 -57
- package/components/dashboard/admin/systemSettingsForm.tsx +0 -289
- package/dist/chunk-2BJ3B4FR.mjs.map +0 -1
- package/dist/chunk-653GF7OT.mjs.map +0 -1
- package/dist/chunk-6OAHCEDJ.mjs.map +0 -1
- package/dist/chunk-K2GCSLRJ.mjs.map +0 -1
- package/dist/chunk-L242CZ64.mjs.map +0 -1
- package/dist/chunk-NQELV53D.mjs.map +0 -1
- package/dist/chunk-O5EQYHNC.mjs.map +0 -1
- package/dist/chunk-TE5BEAQB.mjs.map +0 -1
- package/dist/chunk-VVXYKVFJ.mjs.map +0 -1
- package/dist/email-template-passkey-change-F5Q2SXHD.mjs.map +0 -1
- package/dist/email-template-reset-password-QTCQNXOD.mjs.map +0 -1
- package/dist/email-template-verify-email-WZDCCAKK.mjs.map +0 -1
- /package/components/dashboard/{heartbeat.tsx → common/heartbeat.tsx} +0 -0
- /package/components/email/{email-template-reset-password.tsx → auth/reset-password.tsx} +0 -0
- /package/components/email/{email-template-verify-email.tsx → auth/verify-email.tsx} +0 -0
- /package/components/email/{email-template-welcome.tsx → auth/welcome.tsx} +0 -0
- /package/components/email/{email-template.tsx → layout/base-layout.tsx} +0 -0
- /package/components/email/{email-template-2.tsx → marketing/general-announcement.tsx} +0 -0
- /package/components/email/{email-template-banned.tsx → security/account-banned.tsx} +0 -0
- /package/components/email/{email-template-new-device.tsx → security/new-device-alert.tsx} +0 -0
- /package/components/email/{email-template-passkey-change.tsx → security/passkey-changed.tsx} +0 -0
- /package/lib/{auth-client.ts → auth/client.ts} +0 -0
- /package/lib/{maintenance.ts → config/maintenance.ts} +0 -0
- /package/lib/{cookie-consent.ts → security/cookie-consent.ts} +0 -0
- /package/lib/{cookie-names.ts → security/cookie-names.ts} +0 -0
- /package/lib/{device-fingerprint.ts → security/device-fingerprint.ts} +0 -0
- /package/lib/{formatters.ts → utils/formatters.ts} +0 -0
- /package/lib/{recalculate-columns.ts → utils/recalculate-columns.ts} +0 -0
- /package/lib/{request-info.ts → utils/request-info.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xk2800/nextjs-template",
|
|
3
|
-
"version": "0.7.2-beta.
|
|
3
|
+
"version": "0.7.2-beta.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,16 +44,21 @@
|
|
|
44
44
|
"components/providers",
|
|
45
45
|
"components/email",
|
|
46
46
|
"components/dashboard",
|
|
47
|
-
"components/
|
|
47
|
+
"components/settings",
|
|
48
|
+
"components/error-boundary.tsx",
|
|
49
|
+
"components/site/compliance/cookie-banner.tsx",
|
|
50
|
+
"components/site/push/push-notifications-card.tsx",
|
|
48
51
|
"lib/utils.ts",
|
|
49
|
-
"lib/auth
|
|
50
|
-
"lib/formatters.ts",
|
|
51
|
-
"lib/recalculate-columns.ts",
|
|
52
|
-
"lib/maintenance.ts",
|
|
53
|
-
"lib/cookie-names.ts",
|
|
54
|
-
"lib/
|
|
55
|
-
"lib/
|
|
56
|
-
"lib/
|
|
52
|
+
"lib/auth/client.ts",
|
|
53
|
+
"lib/utils/formatters.ts",
|
|
54
|
+
"lib/utils/recalculate-columns.ts",
|
|
55
|
+
"lib/config/maintenance.ts",
|
|
56
|
+
"lib/security/cookie-names.ts",
|
|
57
|
+
"lib/security/activity-severity.ts",
|
|
58
|
+
"lib/security/cookie-consent.ts",
|
|
59
|
+
"lib/security/device-fingerprint.ts",
|
|
60
|
+
"lib/utils/request-info.ts",
|
|
61
|
+
"lib/push/client.ts",
|
|
57
62
|
"hooks/use-dimensions.ts",
|
|
58
63
|
"hooks/use-mobile.ts",
|
|
59
64
|
"types/auth",
|
|
@@ -153,16 +158,106 @@
|
|
|
153
158
|
"require": "./dist/api/marketing.js"
|
|
154
159
|
},
|
|
155
160
|
"./lib/utils": "./lib/utils.ts",
|
|
156
|
-
"./lib/formatters": "./lib/formatters.ts",
|
|
157
|
-
"./lib/recalculate-columns": "./lib/recalculate-columns.ts",
|
|
158
|
-
"./lib/maintenance": "./lib/maintenance.ts",
|
|
159
|
-
"./lib/cookie-consent": "./lib/cookie-consent.ts",
|
|
160
|
-
"./lib/cookie-names": "./lib/cookie-names.ts",
|
|
161
|
-
"./lib/device-fingerprint": "./lib/device-fingerprint.ts",
|
|
162
|
-
"./lib/request-info": "./lib/request-info.ts",
|
|
161
|
+
"./lib/formatters": "./lib/utils/formatters.ts",
|
|
162
|
+
"./lib/recalculate-columns": "./lib/utils/recalculate-columns.ts",
|
|
163
|
+
"./lib/maintenance": "./lib/config/maintenance.ts",
|
|
164
|
+
"./lib/cookie-consent": "./lib/security/cookie-consent.ts",
|
|
165
|
+
"./lib/cookie-names": "./lib/security/cookie-names.ts",
|
|
166
|
+
"./lib/device-fingerprint": "./lib/security/device-fingerprint.ts",
|
|
167
|
+
"./lib/request-info": "./lib/utils/request-info.ts",
|
|
168
|
+
"./lib/push-client": "./lib/push/client.ts",
|
|
163
169
|
"./hooks/use-dimensions": "./hooks/use-dimensions.ts",
|
|
164
170
|
"./hooks/use-mobile": "./hooks/use-mobile.ts",
|
|
165
171
|
"./styles/theme.css": "./styles/theme.css",
|
|
172
|
+
"./components/dashboard/accountDetailsCard": "./components/dashboard/settings/account-details-card.tsx",
|
|
173
|
+
"./components/dashboard/activityLogsCard": "./components/dashboard/settings/activity-logs-card.tsx",
|
|
174
|
+
"./components/dashboard/activityLogsCardSkeleton": "./components/dashboard/settings/skeletons/activity-logs-card-skeleton.tsx",
|
|
175
|
+
"./components/dashboard/activityLogsSection": "./components/dashboard/settings/activity-logs-section.tsx",
|
|
176
|
+
"./components/dashboard/adminSection": "./components/dashboard/settings/admin-section.tsx",
|
|
177
|
+
"./components/dashboard/appSidebar": "./components/dashboard/layout/app-sidebar.tsx",
|
|
178
|
+
"./components/dashboard/dashboardHeader": "./components/dashboard/layout/dashboard-header.tsx",
|
|
179
|
+
"./components/dashboard/deleteAccountCard": "./components/dashboard/settings/delete-account-card.tsx",
|
|
180
|
+
"./components/dashboard/errorFeedback": "./components/dashboard/common/error-feedback.tsx",
|
|
181
|
+
"./components/dashboard/feedbackDialog": "./components/dashboard/common/feedback-dialog.tsx",
|
|
182
|
+
"./components/dashboard/heartbeat": "./components/dashboard/common/heartbeat.tsx",
|
|
183
|
+
"./components/dashboard/impersonationBanner": "./components/dashboard/layout/impersonation-banner.tsx",
|
|
184
|
+
"./components/dashboard/installAppCard": "./components/dashboard/overview/install-app-card.tsx",
|
|
185
|
+
"./components/dashboard/marketingUpdatesCard": "./components/dashboard/settings/marketing-updates-card.tsx",
|
|
186
|
+
"./components/dashboard/marketingUpdatesSection": "./components/dashboard/settings/marketing-updates-section.tsx",
|
|
187
|
+
"./components/dashboard/navStyleToggle": "./components/dashboard/layout/nav-style-toggle.tsx",
|
|
188
|
+
"./components/dashboard/passkeysCard": "./components/dashboard/settings/passkeys-card.tsx",
|
|
189
|
+
"./components/dashboard/profileCard": "./components/dashboard/settings/profile-card.tsx",
|
|
190
|
+
"./components/dashboard/sectionErrorFallback": "./components/dashboard/common/section-error-fallback.tsx",
|
|
191
|
+
"./components/dashboard/sessionsCard": "./components/dashboard/settings/sessions/sessions-card.tsx",
|
|
192
|
+
"./components/dashboard/sessionsCardSkeleton": "./components/dashboard/settings/sessions/skeletons/sessions-card-skeleton.tsx",
|
|
193
|
+
"./components/dashboard/sessionsSection": "./components/dashboard/settings/sessions/sessions-section.tsx",
|
|
194
|
+
"./components/dashboard/topNav": "./components/dashboard/layout/top-nav.tsx",
|
|
195
|
+
"./components/dashboard/twoFactorCard": "./components/dashboard/settings/two-factor-card.tsx",
|
|
196
|
+
"./components/dashboard/verifyEmailButton": "./components/dashboard/common/verify-email-button.tsx",
|
|
197
|
+
"./components/dashboard/admin/activityLogsSection": "./components/dashboard/admin/activity-logs/activity-logs-section.tsx",
|
|
198
|
+
"./components/dashboard/admin/adminActivityLogsSkeleton": "./components/dashboard/admin/activity-logs/skeletons/activity-logs-skeleton.tsx",
|
|
199
|
+
"./components/dashboard/admin/adminActivityLogsTable": "./components/dashboard/admin/activity-logs/admin-activity-logs-table.tsx",
|
|
200
|
+
"./components/dashboard/admin/adminStatsGrid": "./components/dashboard/admin/home/admin-stats-grid.tsx",
|
|
201
|
+
"./components/dashboard/admin/adminStatsGridSkeleton": "./components/dashboard/admin/home/skeletons/admin-stats-skeleton.tsx",
|
|
202
|
+
"./components/dashboard/admin/adminUserActions": "./components/dashboard/admin/users/admin-user-actions.tsx",
|
|
203
|
+
"./components/dashboard/admin/adminUserActivityLogCard": "./components/dashboard/admin/users/detail/admin-user-activity-log-card.tsx",
|
|
204
|
+
"./components/dashboard/admin/adminUserActivityLogTable": "./components/dashboard/admin/users/detail/admin-user-activity-log-table.tsx",
|
|
205
|
+
"./components/dashboard/admin/adminUserConsentCard": "./components/dashboard/admin/users/detail/admin-user-consent-card.tsx",
|
|
206
|
+
"./components/dashboard/admin/adminUserDevicesCard": "./components/dashboard/admin/users/detail/admin-user-devices-card.tsx",
|
|
207
|
+
"./components/dashboard/admin/adminUserLoginInfoCard": "./components/dashboard/admin/users/detail/admin-user-login-info-card.tsx",
|
|
208
|
+
"./components/dashboard/admin/adminUserLoginInfoTable": "./components/dashboard/admin/users/detail/admin-user-login-info-table.tsx",
|
|
209
|
+
"./components/dashboard/admin/adminUserProfileCard": "./components/dashboard/admin/users/admin-user-profile-card.tsx",
|
|
210
|
+
"./components/dashboard/admin/adminUserSecurityCard": "./components/dashboard/admin/users/admin-user-security-card.tsx",
|
|
211
|
+
"./components/dashboard/admin/adminUserSessionsCard": "./components/dashboard/admin/users/detail/admin-user-sessions-card.tsx",
|
|
212
|
+
"./components/dashboard/admin/adminUserStatusCard": "./components/dashboard/admin/users/admin-user-status-card.tsx",
|
|
213
|
+
"./components/dashboard/admin/adminUsersSkeleton": "./components/dashboard/admin/users/skeletons/admin-users-skeleton.tsx",
|
|
214
|
+
"./components/dashboard/admin/adminUsersTable": "./components/dashboard/admin/users/admin-users-table.tsx",
|
|
215
|
+
"./components/dashboard/admin/auditSeverityBadge": "./components/dashboard/admin/activity-logs/audit-severity-badge.tsx",
|
|
216
|
+
"./components/dashboard/admin/broadcastActions": "./components/dashboard/admin/marketing/broadcast-actions.tsx",
|
|
217
|
+
"./components/dashboard/admin/confirmSendDialog": "./components/dashboard/admin/marketing/confirm-send-dialog.tsx",
|
|
218
|
+
"./components/dashboard/admin/deviceThrottleCard": "./components/dashboard/admin/home/device-throttle-card.tsx",
|
|
219
|
+
"./components/dashboard/admin/deviceThrottleTable": "./components/dashboard/admin/home/device-throttle-table.tsx",
|
|
220
|
+
"./components/dashboard/admin/feedbackTestForm": "./components/dashboard/admin/system-settings/feedback-test-form.tsx",
|
|
221
|
+
"./components/dashboard/admin/impersonationLogCard": "./components/dashboard/admin/users/impersonation-log-card.tsx",
|
|
222
|
+
"./components/dashboard/admin/impersonationTab": "./components/dashboard/admin/users/impersonation-tab.tsx",
|
|
223
|
+
"./components/dashboard/admin/inviteUserDialog": "./components/dashboard/admin/users/invite-user-dialog.tsx",
|
|
224
|
+
"./components/dashboard/admin/marketingEmailForm": "./components/dashboard/admin/marketing/marketing-email-form.tsx",
|
|
225
|
+
"./components/dashboard/admin/marketingSection": "./components/dashboard/admin/marketing/marketing-section.tsx",
|
|
226
|
+
"./components/dashboard/admin/newDeviceCard": "./components/dashboard/admin/home/new-device-card.tsx",
|
|
227
|
+
"./components/dashboard/admin/newDeviceTable": "./components/dashboard/admin/home/new-device-table.tsx",
|
|
228
|
+
"./components/dashboard/admin/revokeAllSessionsButton": "./components/dashboard/admin/users/revoke-all-sessions.tsx",
|
|
229
|
+
"./components/dashboard/admin/securityHighlightsCollapsible": "./components/dashboard/admin/activity-logs/security-highlights-collapsible.tsx",
|
|
230
|
+
"./components/dashboard/admin/sharedDeviceCard": "./components/dashboard/admin/home/shared-device-card.tsx",
|
|
231
|
+
"./components/dashboard/admin/sharedDeviceTable": "./components/dashboard/admin/home/shared-device-table.tsx",
|
|
232
|
+
"./components/dashboard/admin/subscribersCard": "./components/dashboard/admin/marketing/subscribers-card.tsx",
|
|
233
|
+
"./components/dashboard/admin/systemSettingsForm": "./components/dashboard/admin/system-settings/system-settings-form.tsx",
|
|
234
|
+
"./components/dashboard/admin/systemSettingsSection": "./components/dashboard/admin/system-settings/system-settings-section.tsx",
|
|
235
|
+
"./components/dashboard/admin/systemSettingsSkeleton": "./components/dashboard/admin/system-settings/skeletons/system-settings-skeleton.tsx",
|
|
236
|
+
"./components/dashboard/admin/usersSection": "./components/dashboard/admin/users/users-section.tsx",
|
|
237
|
+
"./components/auth/authCard": "./components/auth/layout/auth-card.tsx",
|
|
238
|
+
"./components/auth/authShell": "./components/auth/layout/auth-shell.tsx",
|
|
239
|
+
"./components/auth/deviceCheck": "./components/auth/session/device-check.tsx",
|
|
240
|
+
"./components/auth/emailPasswordLogin": "./components/auth/forms/login-form.tsx",
|
|
241
|
+
"./components/auth/emailPasswordSignup": "./components/auth/forms/signup-form.tsx",
|
|
242
|
+
"./components/auth/forgotPasswordForm": "./components/auth/recovery/forgot-password-form.tsx",
|
|
243
|
+
"./components/auth/loginErrorRecovery": "./components/auth/forms/login-error-recovery.tsx",
|
|
244
|
+
"./components/auth/logoutButtons": "./components/auth/session/logout-buttons.tsx",
|
|
245
|
+
"./components/auth/oneTap": "./components/auth/methods/one-tap.tsx",
|
|
246
|
+
"./components/auth/passkeyLogin": "./components/auth/methods/passkey-login.tsx",
|
|
247
|
+
"./components/auth/resetPasswordForm": "./components/auth/recovery/reset-password-form.tsx",
|
|
248
|
+
"./components/auth/socialLogin": "./components/auth/methods/social-login.tsx",
|
|
249
|
+
"./components/auth/twoFactorVerifyForm": "./components/auth/mfa/two-factor-verify-form.tsx",
|
|
250
|
+
"./components/email/email-template-2": "./components/email/marketing/general-announcement.tsx",
|
|
251
|
+
"./components/email/email-template-banned": "./components/email/security/account-banned.tsx",
|
|
252
|
+
"./components/email/email-template-invite": "./components/email/team/workspace-invite.tsx",
|
|
253
|
+
"./components/email/email-template-new-device": "./components/email/security/new-device-alert.tsx",
|
|
254
|
+
"./components/email/email-template-passkey-change": "./components/email/security/passkey-changed.tsx",
|
|
255
|
+
"./components/email/email-template-reset-password": "./components/email/auth/reset-password.tsx",
|
|
256
|
+
"./components/email/email-template-verify-email": "./components/email/auth/verify-email.tsx",
|
|
257
|
+
"./components/email/email-template-welcome": "./components/email/auth/welcome.tsx",
|
|
258
|
+
"./components/email/email-template": "./components/email/layout/base-layout.tsx",
|
|
259
|
+
"./components/email/send-email-button": "./components/email/ui/send-email-button.tsx",
|
|
260
|
+
"./components/site/cookie-banner": "./components/site/compliance/cookie-banner.tsx",
|
|
166
261
|
"./components/*": "./components/*.tsx"
|
|
167
262
|
},
|
|
168
263
|
"typesVersions": {
|
|
@@ -228,7 +323,7 @@
|
|
|
228
323
|
"build": "npm run build:lib && next build",
|
|
229
324
|
"start": "next start",
|
|
230
325
|
"lint": "next lint",
|
|
231
|
-
"test": "bun lib/recalculate-columns.test.ts && bun lib/two-factor.test.ts && bun lib/auth-throttle-limits.test.ts && bun lib/shared-devices.test.ts && bun lib/maintenance.test.ts && bun lib/install-target.test.ts && bun lib/file-upload-accept.test.ts && bun lib/cookie-names.test.ts && bun lib/marketing-email.test.ts && bun scripts/bump-version.test.ts",
|
|
326
|
+
"test": "bun lib/utils/__tests__/recalculate-columns.test.ts && bun lib/auth/__tests__/two-factor.test.ts && bun lib/auth/__tests__/auth-throttle-limits.test.ts && bun lib/security/__tests__/shared-devices.test.ts && bun lib/config/__tests__/maintenance.test.ts && bun lib/utils/__tests__/install-target.test.ts && bun lib/utils/__tests__/file-upload-accept.test.ts && bun lib/security/__tests__/cookie-names.test.ts && bun lib/email/__tests__/marketing-email.test.ts && bun scripts/bump-version.test.ts",
|
|
232
327
|
"build:lib": "tsup",
|
|
233
328
|
"storybook": "storybook dev -p 6006",
|
|
234
329
|
"build-storybook": "storybook build",
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useEffect, useRef, useState } from 'react'
|
|
4
|
-
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '../../ui/card'
|
|
5
|
-
import { Button } from '../../ui/button'
|
|
6
|
-
import { Input } from '../../ui/input'
|
|
7
|
-
import { Label } from '../../ui/label'
|
|
8
|
-
import { Badge } from '../../ui/badge'
|
|
9
|
-
import { Skeleton } from '../../ui/skeleton'
|
|
10
|
-
import { DataTable, DataTablePagination, type Column } from '../../ui/data-table'
|
|
11
|
-
import { toast } from 'sonner'
|
|
12
|
-
import { formatDateTime } from '@xk2800/nextjs-template/lib/formatters'
|
|
13
|
-
import { Download } from 'lucide-react'
|
|
14
|
-
|
|
15
|
-
interface ActivityLog {
|
|
16
|
-
id: string
|
|
17
|
-
action: string
|
|
18
|
-
description: string
|
|
19
|
-
ipAddress: string | null
|
|
20
|
-
userAgent: string | null
|
|
21
|
-
metadata: string | null
|
|
22
|
-
createdAt: Date | string
|
|
23
|
-
userId: string
|
|
24
|
-
userName: string | null
|
|
25
|
-
userEmail: string | null
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface PaginationData {
|
|
29
|
-
page: number
|
|
30
|
-
limit: number
|
|
31
|
-
total: number
|
|
32
|
-
pages: number
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const actionOptions = [
|
|
36
|
-
{ value: '', label: 'All actions' },
|
|
37
|
-
{ value: 'login', label: 'Login' },
|
|
38
|
-
{ value: 'logout', label: 'Logout' },
|
|
39
|
-
{ value: 'login_failed', label: 'Login failed' },
|
|
40
|
-
{ value: 'password_changed', label: 'Password changed' },
|
|
41
|
-
{ value: 'email_changed', label: 'Email changed' },
|
|
42
|
-
{ value: 'profile_updated', label: 'Profile updated' },
|
|
43
|
-
{ value: 'session_revoked', label: 'Session revoked' },
|
|
44
|
-
{ value: 'user_deleted', label: 'User deleted' },
|
|
45
|
-
{ value: 'user_banned', label: 'User banned' },
|
|
46
|
-
{ value: 'user_unbanned', label: 'User unbanned' },
|
|
47
|
-
{ value: 'role_changed', label: 'Role changed' },
|
|
48
|
-
{ value: 'impersonation_started', label: 'Impersonation started' },
|
|
49
|
-
{ value: 'impersonation_stopped', label: 'Impersonation stopped' },
|
|
50
|
-
{ value: 'settings_changed', label: 'Settings changed' },
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
const actionBadgeVariant: Record<string, 'default' | 'secondary' | 'destructive' | 'outline'> = {
|
|
54
|
-
login: 'default',
|
|
55
|
-
logout: 'secondary',
|
|
56
|
-
login_failed: 'destructive',
|
|
57
|
-
password_changed: 'default',
|
|
58
|
-
email_changed: 'default',
|
|
59
|
-
profile_updated: 'secondary',
|
|
60
|
-
session_revoked: 'destructive',
|
|
61
|
-
user_deleted: 'destructive',
|
|
62
|
-
user_banned: 'destructive',
|
|
63
|
-
user_unbanned: 'default',
|
|
64
|
-
role_changed: 'default',
|
|
65
|
-
impersonation_started: 'destructive',
|
|
66
|
-
impersonation_stopped: 'secondary',
|
|
67
|
-
settings_changed: 'default',
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface AdminActivityLogsTableProps {
|
|
71
|
-
initialLogs: ActivityLog[]
|
|
72
|
-
initialPagination: PaginationData
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const columns: Column<ActivityLog>[] = [
|
|
76
|
-
{
|
|
77
|
-
name: 'action',
|
|
78
|
-
title: 'Action',
|
|
79
|
-
sticky: true,
|
|
80
|
-
minWidth: 110,
|
|
81
|
-
renderer: (log) => (
|
|
82
|
-
<Badge variant={actionBadgeVariant[log.action] || 'outline'}>
|
|
83
|
-
{log.action.replace(/_/g, ' ')}
|
|
84
|
-
</Badge>
|
|
85
|
-
),
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'user',
|
|
89
|
-
title: 'User',
|
|
90
|
-
priority: -1,
|
|
91
|
-
minWidth: 260,
|
|
92
|
-
renderer: (log) => (
|
|
93
|
-
<div className="text-sm">
|
|
94
|
-
<div className="font-medium">{log.userName || 'N/A'}</div>
|
|
95
|
-
<div className="text-xs text-gray-500">{log.userEmail}</div>
|
|
96
|
-
</div>
|
|
97
|
-
),
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: 'description',
|
|
101
|
-
title: 'Description',
|
|
102
|
-
renderer: (log) => (
|
|
103
|
-
<span className="text-sm max-w-xs truncate block">{log.description}</span>
|
|
104
|
-
),
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'ipAddress',
|
|
108
|
-
title: 'IP Address',
|
|
109
|
-
renderer: (log) => <span className="text-sm font-mono">{log.ipAddress || 'N/A'}</span>,
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: 'createdAt',
|
|
113
|
-
title: 'Time',
|
|
114
|
-
priority: 0,
|
|
115
|
-
renderer: (log) => (
|
|
116
|
-
<span className="text-sm text-gray-600 dark:text-gray-400">
|
|
117
|
-
{formatDateTime(log.createdAt)}
|
|
118
|
-
</span>
|
|
119
|
-
),
|
|
120
|
-
},
|
|
121
|
-
]
|
|
122
|
-
|
|
123
|
-
export default function AdminActivityLogsTable({ initialLogs, initialPagination }: AdminActivityLogsTableProps) {
|
|
124
|
-
const [logs, setLogs] = useState<ActivityLog[]>(initialLogs)
|
|
125
|
-
const [loading, setLoading] = useState(false)
|
|
126
|
-
const [search, setSearch] = useState('')
|
|
127
|
-
const [action, setAction] = useState('')
|
|
128
|
-
const [dateFrom, setDateFrom] = useState('')
|
|
129
|
-
const [dateTo, setDateTo] = useState('')
|
|
130
|
-
const [page, setPage] = useState(1)
|
|
131
|
-
const [pagination, setPagination] = useState<PaginationData | null>(initialPagination)
|
|
132
|
-
const [isExporting, setIsExporting] = useState(false)
|
|
133
|
-
|
|
134
|
-
const requestId = useRef(0)
|
|
135
|
-
|
|
136
|
-
const fetchLogs = async (pageNum: number) => {
|
|
137
|
-
const currentRequest = ++requestId.current
|
|
138
|
-
setLoading(true)
|
|
139
|
-
try {
|
|
140
|
-
const params = new URLSearchParams({
|
|
141
|
-
page: pageNum.toString(),
|
|
142
|
-
limit: '20',
|
|
143
|
-
search,
|
|
144
|
-
action,
|
|
145
|
-
...(dateFrom && { dateFrom }),
|
|
146
|
-
...(dateTo && { dateTo }),
|
|
147
|
-
})
|
|
148
|
-
const response = await fetch(`/api/admin/activity-logs?${params}`)
|
|
149
|
-
if (!response.ok) throw new Error('Failed to fetch activity logs')
|
|
150
|
-
const data = await response.json()
|
|
151
|
-
if (currentRequest !== requestId.current) return
|
|
152
|
-
setLogs(data.logs)
|
|
153
|
-
setPagination(data.pagination)
|
|
154
|
-
} catch (error) {
|
|
155
|
-
if (currentRequest !== requestId.current) return
|
|
156
|
-
toast.error('Failed to load activity logs')
|
|
157
|
-
console.error(error)
|
|
158
|
-
} finally {
|
|
159
|
-
if (currentRequest === requestId.current) setLoading(false)
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const isFirstRender = useRef(true)
|
|
164
|
-
|
|
165
|
-
useEffect(() => {
|
|
166
|
-
if (isFirstRender.current) {
|
|
167
|
-
isFirstRender.current = false
|
|
168
|
-
return
|
|
169
|
-
}
|
|
170
|
-
const timer = setTimeout(() => {
|
|
171
|
-
fetchLogs(1)
|
|
172
|
-
setPage(1)
|
|
173
|
-
}, 300)
|
|
174
|
-
return () => clearTimeout(timer)
|
|
175
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
176
|
-
}, [search, action, dateFrom, dateTo])
|
|
177
|
-
|
|
178
|
-
const resetFilters = () => {
|
|
179
|
-
setSearch('')
|
|
180
|
-
setAction('')
|
|
181
|
-
setDateFrom('')
|
|
182
|
-
setDateTo('')
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const handleExport = async () => {
|
|
186
|
-
setIsExporting(true)
|
|
187
|
-
try {
|
|
188
|
-
const params = new URLSearchParams({
|
|
189
|
-
search,
|
|
190
|
-
action,
|
|
191
|
-
...(dateFrom && { dateFrom }),
|
|
192
|
-
...(dateTo && { dateTo }),
|
|
193
|
-
})
|
|
194
|
-
const response = await fetch(`/api/admin/activity-logs/export?${params}`)
|
|
195
|
-
if (!response.ok) throw new Error('Failed to export activity logs')
|
|
196
|
-
const blob = await response.blob()
|
|
197
|
-
const url = URL.createObjectURL(blob)
|
|
198
|
-
const link = document.createElement('a')
|
|
199
|
-
link.href = url
|
|
200
|
-
link.download = `activity-logs-${new Date().toISOString().slice(0, 10)}.csv`
|
|
201
|
-
document.body.appendChild(link)
|
|
202
|
-
link.click()
|
|
203
|
-
link.remove()
|
|
204
|
-
URL.revokeObjectURL(url)
|
|
205
|
-
} catch (error) {
|
|
206
|
-
toast.error('Failed to export activity logs')
|
|
207
|
-
console.error(error)
|
|
208
|
-
} finally {
|
|
209
|
-
setIsExporting(false)
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return (
|
|
214
|
-
<>
|
|
215
|
-
<Card>
|
|
216
|
-
<CardHeader>
|
|
217
|
-
<CardTitle>Filters</CardTitle>
|
|
218
|
-
<CardDescription>Search and narrow down activity events</CardDescription>
|
|
219
|
-
</CardHeader>
|
|
220
|
-
<CardContent>
|
|
221
|
-
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4 items-end">
|
|
222
|
-
<div className="space-y-2 lg:col-span-2">
|
|
223
|
-
<Label htmlFor="search">User</Label>
|
|
224
|
-
<Input
|
|
225
|
-
id="search"
|
|
226
|
-
placeholder="Search by name or email..."
|
|
227
|
-
value={search}
|
|
228
|
-
onChange={(e) => setSearch(e.target.value)}
|
|
229
|
-
/>
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
<div className="space-y-2">
|
|
233
|
-
<Label htmlFor="action">Action</Label>
|
|
234
|
-
<select
|
|
235
|
-
id="action"
|
|
236
|
-
value={action}
|
|
237
|
-
onChange={(e) => setAction(e.target.value)}
|
|
238
|
-
className="flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] dark:bg-input/30"
|
|
239
|
-
>
|
|
240
|
-
{actionOptions.map((opt) => (
|
|
241
|
-
<option key={opt.value} value={opt.value}>
|
|
242
|
-
{opt.label}
|
|
243
|
-
</option>
|
|
244
|
-
))}
|
|
245
|
-
</select>
|
|
246
|
-
</div>
|
|
247
|
-
|
|
248
|
-
<div className="space-y-2">
|
|
249
|
-
<Label htmlFor="dateFrom">From</Label>
|
|
250
|
-
<Input
|
|
251
|
-
id="dateFrom"
|
|
252
|
-
type="date"
|
|
253
|
-
value={dateFrom}
|
|
254
|
-
onChange={(e) => setDateFrom(e.target.value)}
|
|
255
|
-
/>
|
|
256
|
-
</div>
|
|
257
|
-
|
|
258
|
-
<div className="space-y-2">
|
|
259
|
-
<Label htmlFor="dateTo">To</Label>
|
|
260
|
-
<Input
|
|
261
|
-
id="dateTo"
|
|
262
|
-
type="date"
|
|
263
|
-
value={dateTo}
|
|
264
|
-
onChange={(e) => setDateTo(e.target.value)}
|
|
265
|
-
/>
|
|
266
|
-
</div>
|
|
267
|
-
</div>
|
|
268
|
-
|
|
269
|
-
{(search || action || dateFrom || dateTo) && (
|
|
270
|
-
<Button variant="ghost" size="sm" className="mt-4" onClick={resetFilters}>
|
|
271
|
-
Clear filters
|
|
272
|
-
</Button>
|
|
273
|
-
)}
|
|
274
|
-
</CardContent>
|
|
275
|
-
</Card>
|
|
276
|
-
|
|
277
|
-
<Card>
|
|
278
|
-
<CardHeader className="flex flex-row items-start justify-between gap-4">
|
|
279
|
-
<div>
|
|
280
|
-
<CardTitle>Events</CardTitle>
|
|
281
|
-
<CardDescription>
|
|
282
|
-
{pagination ? `Showing ${logs.length} of ${pagination.total} events` : 'Loading...'}
|
|
283
|
-
</CardDescription>
|
|
284
|
-
</div>
|
|
285
|
-
<Button
|
|
286
|
-
variant="outline"
|
|
287
|
-
size="sm"
|
|
288
|
-
onClick={handleExport}
|
|
289
|
-
disabled={isExporting || logs.length === 0}
|
|
290
|
-
>
|
|
291
|
-
<Download />
|
|
292
|
-
{isExporting ? 'Exporting...' : 'Export CSV'}
|
|
293
|
-
</Button>
|
|
294
|
-
</CardHeader>
|
|
295
|
-
<CardContent>
|
|
296
|
-
{loading ? (
|
|
297
|
-
<div className="space-y-4">
|
|
298
|
-
{[...Array(5)].map((_, i) => (
|
|
299
|
-
<Skeleton key={i} className="h-16 w-full" />
|
|
300
|
-
))}
|
|
301
|
-
</div>
|
|
302
|
-
) : logs.length === 0 ? (
|
|
303
|
-
<p className="text-center text-gray-500 py-8">No activity logs found</p>
|
|
304
|
-
) : (
|
|
305
|
-
<DataTable columns={columns} data={logs} getRowId={(log) => log.id} pageSize={false} />
|
|
306
|
-
)}
|
|
307
|
-
|
|
308
|
-
{pagination && (
|
|
309
|
-
<DataTablePagination
|
|
310
|
-
page={page}
|
|
311
|
-
pages={pagination.pages}
|
|
312
|
-
onPageChange={(p) => {
|
|
313
|
-
setPage(p)
|
|
314
|
-
fetchLogs(p)
|
|
315
|
-
}}
|
|
316
|
-
className="mt-6 pt-6"
|
|
317
|
-
/>
|
|
318
|
-
)}
|
|
319
|
-
</CardContent>
|
|
320
|
-
</Card>
|
|
321
|
-
</>
|
|
322
|
-
)
|
|
323
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, CardTitle } from "../../ui/card"
|
|
2
|
-
import { Badge } from "../../ui/badge"
|
|
3
|
-
import { Separator } from "../../ui/separator"
|
|
4
|
-
import { formatDateTime } from "../../../lib/formatters"
|
|
5
|
-
|
|
6
|
-
type User = {
|
|
7
|
-
banned: boolean
|
|
8
|
-
bannedAt: Date | null
|
|
9
|
-
bannedReason: string | null
|
|
10
|
-
lastLoginAt: Date | null
|
|
11
|
-
lastActiveAt: Date | null
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default function AdminUserStatusCard({ user }: { user: User }) {
|
|
15
|
-
return (
|
|
16
|
-
<Card>
|
|
17
|
-
<CardHeader>
|
|
18
|
-
<CardTitle>Account Status</CardTitle>
|
|
19
|
-
</CardHeader>
|
|
20
|
-
<CardContent className="space-y-4">
|
|
21
|
-
<div>
|
|
22
|
-
<p className="text-sm font-medium text-gray-600">Status</p>
|
|
23
|
-
<div className="mt-1">
|
|
24
|
-
{user.banned ? (
|
|
25
|
-
<Badge variant="destructive">Banned</Badge>
|
|
26
|
-
) : (
|
|
27
|
-
<Badge variant="outline">Active</Badge>
|
|
28
|
-
)}
|
|
29
|
-
</div>
|
|
30
|
-
{user.banned && user.bannedReason && (
|
|
31
|
-
<p className="text-sm text-gray-600 dark:text-gray-400 mt-1">
|
|
32
|
-
{user.bannedReason}
|
|
33
|
-
</p>
|
|
34
|
-
)}
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<Separator />
|
|
38
|
-
|
|
39
|
-
<div>
|
|
40
|
-
<p className="text-sm font-medium text-gray-600">Last Login</p>
|
|
41
|
-
<p className="text-base">
|
|
42
|
-
{user.lastLoginAt ? formatDateTime(user.lastLoginAt) : 'Never'}
|
|
43
|
-
</p>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<Separator />
|
|
47
|
-
|
|
48
|
-
<div>
|
|
49
|
-
<p className="text-sm font-medium text-gray-600">Last Active</p>
|
|
50
|
-
<p className="text-base">
|
|
51
|
-
{user.lastActiveAt ? formatDateTime(user.lastActiveAt) : 'Never'}
|
|
52
|
-
</p>
|
|
53
|
-
</div>
|
|
54
|
-
</CardContent>
|
|
55
|
-
</Card>
|
|
56
|
-
)
|
|
57
|
-
}
|