@nextsparkjs/core 0.1.0-beta.83 → 0.1.0-beta.85
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/styles/classes.json +1 -1
- package/dist/templates/app/(auth)/forgot-password/page.tsx +216 -0
- package/dist/templates/app/(auth)/layout.tsx +51 -0
- package/dist/templates/app/(auth)/login/page.tsx +21 -0
- package/dist/templates/app/(auth)/reset-password/page.tsx +212 -0
- package/dist/templates/app/(auth)/signup/page.tsx +21 -0
- package/dist/templates/app/(auth)/verify-email/page.tsx +190 -0
- package/dist/templates/app/(public)/[...slug]/page.tsx +378 -0
- package/dist/templates/app/(public)/docs/[section]/[page]/page.tsx +90 -0
- package/dist/templates/app/(public)/docs/layout.tsx +25 -0
- package/dist/templates/app/(public)/docs/page.tsx +81 -0
- package/dist/templates/app/(public)/layout.tsx +41 -0
- package/dist/templates/app/(public)/page.tsx +19 -0
- package/dist/templates/app/403/page.tsx +89 -0
- package/dist/templates/app/api/auth/[...all]/route.ts +78 -0
- package/dist/templates/app/api/cron/billing/lifecycle/route.ts +98 -0
- package/dist/templates/app/api/csp-report/route.ts +175 -0
- package/dist/templates/app/api/devtools/config/entities/route.ts +108 -0
- package/dist/templates/app/api/devtools/config/theme/route.ts +66 -0
- package/dist/templates/app/api/devtools/tests/[...path]/route.ts +130 -0
- package/dist/templates/app/api/devtools/tests/route.ts +134 -0
- package/dist/templates/app/api/health/route.ts +29 -0
- package/dist/templates/app/api/internal/user-metadata/route.ts +36 -0
- package/dist/templates/app/api/superadmin/subscriptions/route.ts +310 -0
- package/dist/templates/app/api/superadmin/teams/[teamId]/route.ts +286 -0
- package/dist/templates/app/api/superadmin/teams/route.ts +188 -0
- package/dist/templates/app/api/superadmin/users/[userId]/route.ts +540 -0
- package/dist/templates/app/api/superadmin/users/route.ts +323 -0
- package/dist/templates/app/api/user/delete-account/route.ts +55 -0
- package/dist/templates/app/api/user/plan-flags/route.ts +283 -0
- package/dist/templates/app/api/user/profile/route.ts +133 -0
- package/dist/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +210 -0
- package/dist/templates/app/api/v1/[entity]/[id]/child/[childType]/route.ts +331 -0
- package/dist/templates/app/api/v1/[entity]/[id]/route.ts +35 -0
- package/dist/templates/app/api/v1/[entity]/docs.md +369 -0
- package/dist/templates/app/api/v1/[entity]/presets.ts +194 -0
- package/dist/templates/app/api/v1/[entity]/route.ts +31 -0
- package/dist/templates/app/api/v1/api-keys/[id]/route.ts +303 -0
- package/dist/templates/app/api/v1/api-keys/docs.md +101 -0
- package/dist/templates/app/api/v1/api-keys/presets.ts +31 -0
- package/dist/templates/app/api/v1/api-keys/route.ts +250 -0
- package/dist/templates/app/api/v1/auth/docs.md +184 -0
- package/dist/templates/app/api/v1/auth/presets.ts +44 -0
- package/dist/templates/app/api/v1/auth/signup-with-invite/route.ts +227 -0
- package/dist/templates/app/api/v1/billing/cancel/route.ts +206 -0
- package/dist/templates/app/api/v1/billing/change-plan/route.ts +97 -0
- package/dist/templates/app/api/v1/billing/check-action/route.ts +81 -0
- package/dist/templates/app/api/v1/billing/checkout/route.ts +124 -0
- package/dist/templates/app/api/v1/billing/docs.md +209 -0
- package/dist/templates/app/api/v1/billing/plans/route.ts +85 -0
- package/dist/templates/app/api/v1/billing/portal/route.ts +90 -0
- package/dist/templates/app/api/v1/billing/presets.ts +121 -0
- package/dist/templates/app/api/v1/billing/webhooks/stripe/route.ts +428 -0
- package/dist/templates/app/api/v1/blocks/[slug]/route.ts +29 -0
- package/dist/templates/app/api/v1/blocks/docs.md +173 -0
- package/dist/templates/app/api/v1/blocks/presets.ts +121 -0
- package/dist/templates/app/api/v1/blocks/route.ts +45 -0
- package/dist/templates/app/api/v1/blocks/validate/route.ts +45 -0
- package/dist/templates/app/api/v1/cron/docs.md +116 -0
- package/dist/templates/app/api/v1/cron/presets.ts +26 -0
- package/dist/templates/app/api/v1/cron/process/route.ts +108 -0
- package/dist/templates/app/api/v1/devtools/blocks/route.ts +82 -0
- package/dist/templates/app/api/v1/devtools/docs/route.ts +150 -0
- package/dist/templates/app/api/v1/devtools/docs.md +204 -0
- package/dist/templates/app/api/v1/devtools/features/route.ts +61 -0
- package/dist/templates/app/api/v1/devtools/flows/route.ts +61 -0
- package/dist/templates/app/api/v1/devtools/presets.ts +113 -0
- package/dist/templates/app/api/v1/devtools/scheduled-actions/route.ts +120 -0
- package/dist/templates/app/api/v1/devtools/testing/route.ts +82 -0
- package/dist/templates/app/api/v1/media/docs.md +117 -0
- package/dist/templates/app/api/v1/media/presets.ts +24 -0
- package/dist/templates/app/api/v1/media/upload/route.ts +150 -0
- package/dist/templates/app/api/v1/patterns/[id]/usages/route.ts +116 -0
- package/dist/templates/app/api/v1/plugin/[...path]/route.ts +373 -0
- package/dist/templates/app/api/v1/plugin/docs.md +79 -0
- package/dist/templates/app/api/v1/plugin/presets.ts +21 -0
- package/dist/templates/app/api/v1/plugin/route.ts +96 -0
- package/dist/templates/app/api/v1/post-categories/[id]/route.ts +255 -0
- package/dist/templates/app/api/v1/post-categories/docs.md +134 -0
- package/dist/templates/app/api/v1/post-categories/presets.ts +78 -0
- package/dist/templates/app/api/v1/post-categories/route.ts +119 -0
- package/dist/templates/app/api/v1/team-invitations/[token]/accept/route.ts +179 -0
- package/dist/templates/app/api/v1/team-invitations/[token]/decline/route.ts +120 -0
- package/dist/templates/app/api/v1/team-invitations/[token]/route.ts +89 -0
- package/dist/templates/app/api/v1/team-invitations/docs.md +88 -0
- package/dist/templates/app/api/v1/team-invitations/presets.ts +43 -0
- package/dist/templates/app/api/v1/team-invitations/route.ts +114 -0
- package/dist/templates/app/api/v1/teams/[teamId]/invitations/route.ts +171 -0
- package/dist/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +105 -0
- package/dist/templates/app/api/v1/teams/[teamId]/invoices/route.ts +125 -0
- package/dist/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +263 -0
- package/dist/templates/app/api/v1/teams/[teamId]/members/route.ts +358 -0
- package/dist/templates/app/api/v1/teams/[teamId]/route.ts +322 -0
- package/dist/templates/app/api/v1/teams/[teamId]/subscription/route.ts +50 -0
- package/dist/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +91 -0
- package/dist/templates/app/api/v1/teams/docs.md +320 -0
- package/dist/templates/app/api/v1/teams/presets.ts +178 -0
- package/dist/templates/app/api/v1/teams/route.ts +293 -0
- package/dist/templates/app/api/v1/teams/switch/route.ts +88 -0
- package/dist/templates/app/api/v1/theme/[...path]/route.ts +361 -0
- package/dist/templates/app/api/v1/theme/docs.md +74 -0
- package/dist/templates/app/api/v1/theme/presets.ts +21 -0
- package/dist/templates/app/api/v1/theme/route.ts +96 -0
- package/dist/templates/app/api/v1/users/[id]/meta/[key]/route.ts +363 -0
- package/dist/templates/app/api/v1/users/[id]/route.ts +302 -0
- package/dist/templates/app/api/v1/users/docs.md +93 -0
- package/dist/templates/app/api/v1/users/presets.ts +59 -0
- package/dist/templates/app/api/v1/users/route.ts +197 -0
- package/dist/templates/app/dashboard/(main)/[entity]/[id]/edit/page.tsx +117 -0
- package/dist/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +103 -0
- package/dist/templates/app/dashboard/(main)/[entity]/create/page.tsx +95 -0
- package/dist/templates/app/dashboard/(main)/[entity]/error.tsx +51 -0
- package/dist/templates/app/dashboard/(main)/[entity]/layout.tsx +113 -0
- package/dist/templates/app/dashboard/(main)/[entity]/loading.tsx +61 -0
- package/dist/templates/app/dashboard/(main)/[entity]/page.tsx +90 -0
- package/dist/templates/app/dashboard/(main)/layout.tsx +98 -0
- package/dist/templates/app/dashboard/(main)/loading.tsx +5 -0
- package/dist/templates/app/dashboard/(main)/page.tsx +201 -0
- package/dist/templates/app/dashboard/(main)/patterns/[id]/edit/page.tsx +114 -0
- package/dist/templates/app/dashboard/(main)/patterns/[id]/page.tsx +20 -0
- package/dist/templates/app/dashboard/(main)/patterns/[id]/reports/page.tsx +171 -0
- package/dist/templates/app/dashboard/(main)/patterns/create/page.tsx +86 -0
- package/dist/templates/app/dashboard/(main)/patterns/page.tsx +444 -0
- package/dist/templates/app/dashboard/features/analytics/page.tsx +35 -0
- package/dist/templates/app/dashboard/features/automation/page.tsx +35 -0
- package/dist/templates/app/dashboard/features/layout.tsx +13 -0
- package/dist/templates/app/dashboard/features/loading.tsx +5 -0
- package/dist/templates/app/dashboard/features/webhooks/page.tsx +35 -0
- package/dist/templates/app/dashboard/layout.tsx +86 -0
- package/dist/templates/app/dashboard/permission-denied/page.tsx +29 -0
- package/dist/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/api-keys/page.tsx +513 -0
- package/dist/templates/app/dashboard/settings/billing/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/billing/page.tsx +284 -0
- package/dist/templates/app/dashboard/settings/invoices/[invoiceNumber]/page.tsx +222 -0
- package/dist/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/invoices/page.tsx +82 -0
- package/dist/templates/app/dashboard/settings/layout.tsx +151 -0
- package/dist/templates/app/dashboard/settings/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/notifications/page.tsx +462 -0
- package/dist/templates/app/dashboard/settings/page.tsx +92 -0
- package/dist/templates/app/dashboard/settings/password/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/password/page.tsx +306 -0
- package/dist/templates/app/dashboard/settings/plans/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/plans/page.tsx +40 -0
- package/dist/templates/app/dashboard/settings/profile/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/profile/page.tsx +686 -0
- package/dist/templates/app/dashboard/settings/security/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/security/page.tsx +505 -0
- package/dist/templates/app/dashboard/settings/teams/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/teams/page.tsx +272 -0
- package/dist/templates/app/dashboard/settings/teams/permissions/page.tsx +92 -0
- package/dist/templates/app/devtools/blocks/[slug]/page.tsx +39 -0
- package/dist/templates/app/devtools/blocks/page.tsx +31 -0
- package/dist/templates/app/devtools/config/page.tsx +31 -0
- package/dist/templates/app/devtools/features/page.tsx +31 -0
- package/dist/templates/app/devtools/flows/page.tsx +31 -0
- package/dist/templates/app/devtools/layout.tsx +58 -0
- package/dist/templates/app/devtools/page.tsx +121 -0
- package/dist/templates/app/devtools/scheduled-actions/page.tsx +157 -0
- package/dist/templates/app/devtools/style/page.tsx +330 -0
- package/dist/templates/app/devtools/tags/page.tsx +31 -0
- package/dist/templates/app/devtools/tests/[[...path]]/page.tsx +47 -0
- package/dist/templates/app/favicon.ico +0 -0
- package/dist/templates/app/globals.css +12 -0
- package/dist/templates/app/layout.tsx +96 -0
- package/dist/templates/app/public/page.tsx +30 -0
- package/dist/templates/app/superadmin/docs/[section]/[page]/page.tsx +92 -0
- package/dist/templates/app/superadmin/docs/page.tsx +75 -0
- package/dist/templates/app/superadmin/layout.tsx +67 -0
- package/dist/templates/app/superadmin/page.tsx +149 -0
- package/dist/templates/app/superadmin/subscriptions/page.tsx +655 -0
- package/dist/templates/app/superadmin/team-roles/page.tsx +493 -0
- package/dist/templates/app/superadmin/teams/[teamId]/page.tsx +687 -0
- package/dist/templates/app/superadmin/teams/page.tsx +302 -0
- package/dist/templates/app/superadmin/users/[userId]/page.tsx +548 -0
- package/dist/templates/app/superadmin/users/page.tsx +528 -0
- package/package.json +15 -15
- package/scripts/build/docs-registry.mjs +0 -0
- package/scripts/create-theme.mjs +0 -0
- package/scripts/deploy/release-version.mjs +0 -0
- package/scripts/deploy/vercel-deploy.mjs +0 -0
- package/scripts/dev/watch-plugins.mjs +0 -0
- package/scripts/maintenance/update-core.mjs +0 -0
- package/scripts/setup/npm-postinstall.mjs +0 -0
- package/scripts/setup/setup-claude.mjs +0 -0
- package/scripts/validation/check-imports.sh +0 -0
- package/templates/app/(auth)/forgot-password/page.tsx +216 -0
- package/templates/app/(auth)/layout.tsx +51 -0
- package/templates/app/(auth)/login/page.tsx +21 -0
- package/templates/app/(auth)/reset-password/page.tsx +212 -0
- package/templates/app/(auth)/signup/page.tsx +21 -0
- package/templates/app/(auth)/verify-email/page.tsx +190 -0
- package/templates/app/(public)/[...slug]/page.tsx +378 -0
- package/templates/app/(public)/docs/[section]/[page]/page.tsx +90 -0
- package/templates/app/(public)/docs/layout.tsx +25 -0
- package/templates/app/(public)/docs/page.tsx +81 -0
- package/templates/app/(public)/layout.tsx +41 -0
- package/templates/app/(public)/page.tsx +19 -0
- package/templates/app/403/page.tsx +89 -0
- package/templates/app/api/auth/[...all]/route.ts +78 -0
- package/templates/app/api/cron/billing/lifecycle/route.ts +98 -0
- package/templates/app/api/csp-report/route.ts +175 -0
- package/templates/app/api/devtools/config/entities/route.ts +108 -0
- package/templates/app/api/devtools/config/theme/route.ts +66 -0
- package/templates/app/api/devtools/tests/[...path]/route.ts +130 -0
- package/templates/app/api/devtools/tests/route.ts +134 -0
- package/templates/app/api/health/route.ts +29 -0
- package/templates/app/api/internal/user-metadata/route.ts +36 -0
- package/templates/app/api/superadmin/subscriptions/route.ts +310 -0
- package/templates/app/api/superadmin/teams/[teamId]/route.ts +286 -0
- package/templates/app/api/superadmin/teams/route.ts +188 -0
- package/templates/app/api/superadmin/users/[userId]/route.ts +540 -0
- package/templates/app/api/superadmin/users/route.ts +323 -0
- package/templates/app/api/user/delete-account/route.ts +55 -0
- package/templates/app/api/user/plan-flags/route.ts +283 -0
- package/templates/app/api/user/profile/route.ts +133 -0
- package/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +210 -0
- package/templates/app/api/v1/[entity]/[id]/child/[childType]/route.ts +331 -0
- package/templates/app/api/v1/[entity]/[id]/route.ts +35 -0
- package/templates/app/api/v1/[entity]/docs.md +369 -0
- package/templates/app/api/v1/[entity]/presets.ts +194 -0
- package/templates/app/api/v1/[entity]/route.ts +31 -0
- package/templates/app/api/v1/api-keys/[id]/route.ts +303 -0
- package/templates/app/api/v1/api-keys/docs.md +101 -0
- package/templates/app/api/v1/api-keys/presets.ts +31 -0
- package/templates/app/api/v1/api-keys/route.ts +250 -0
- package/templates/app/api/v1/auth/docs.md +184 -0
- package/templates/app/api/v1/auth/presets.ts +44 -0
- package/templates/app/api/v1/auth/signup-with-invite/route.ts +227 -0
- package/templates/app/api/v1/billing/cancel/route.ts +206 -0
- package/templates/app/api/v1/billing/change-plan/route.ts +97 -0
- package/templates/app/api/v1/billing/check-action/route.ts +81 -0
- package/templates/app/api/v1/billing/checkout/route.ts +124 -0
- package/templates/app/api/v1/billing/docs.md +209 -0
- package/templates/app/api/v1/billing/plans/route.ts +85 -0
- package/templates/app/api/v1/billing/portal/route.ts +90 -0
- package/templates/app/api/v1/billing/presets.ts +121 -0
- package/templates/app/api/v1/billing/webhooks/stripe/route.ts +428 -0
- package/templates/app/api/v1/blocks/[slug]/route.ts +29 -0
- package/templates/app/api/v1/blocks/docs.md +173 -0
- package/templates/app/api/v1/blocks/presets.ts +121 -0
- package/templates/app/api/v1/blocks/route.ts +45 -0
- package/templates/app/api/v1/blocks/validate/route.ts +45 -0
- package/templates/app/api/v1/cron/docs.md +116 -0
- package/templates/app/api/v1/cron/presets.ts +26 -0
- package/templates/app/api/v1/cron/process/route.ts +108 -0
- package/templates/app/api/v1/devtools/blocks/route.ts +82 -0
- package/templates/app/api/v1/devtools/docs/route.ts +150 -0
- package/templates/app/api/v1/devtools/docs.md +204 -0
- package/templates/app/api/v1/devtools/features/route.ts +61 -0
- package/templates/app/api/v1/devtools/flows/route.ts +61 -0
- package/templates/app/api/v1/devtools/presets.ts +113 -0
- package/templates/app/api/v1/devtools/scheduled-actions/route.ts +120 -0
- package/templates/app/api/v1/devtools/testing/route.ts +82 -0
- package/templates/app/api/v1/media/docs.md +117 -0
- package/templates/app/api/v1/media/presets.ts +24 -0
- package/templates/app/api/v1/media/upload/route.ts +150 -0
- package/templates/app/api/v1/patterns/[id]/usages/route.ts +116 -0
- package/templates/app/api/v1/plugin/[...path]/route.ts +373 -0
- package/templates/app/api/v1/plugin/docs.md +79 -0
- package/templates/app/api/v1/plugin/presets.ts +21 -0
- package/templates/app/api/v1/plugin/route.ts +96 -0
- package/templates/app/api/v1/post-categories/[id]/route.ts +255 -0
- package/templates/app/api/v1/post-categories/docs.md +134 -0
- package/templates/app/api/v1/post-categories/presets.ts +78 -0
- package/templates/app/api/v1/post-categories/route.ts +119 -0
- package/templates/app/api/v1/team-invitations/[token]/accept/route.ts +179 -0
- package/templates/app/api/v1/team-invitations/[token]/decline/route.ts +120 -0
- package/templates/app/api/v1/team-invitations/[token]/route.ts +89 -0
- package/templates/app/api/v1/team-invitations/docs.md +88 -0
- package/templates/app/api/v1/team-invitations/presets.ts +43 -0
- package/templates/app/api/v1/team-invitations/route.ts +114 -0
- package/templates/app/api/v1/teams/[teamId]/invitations/route.ts +171 -0
- package/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +105 -0
- package/templates/app/api/v1/teams/[teamId]/invoices/route.ts +125 -0
- package/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +263 -0
- package/templates/app/api/v1/teams/[teamId]/members/route.ts +358 -0
- package/templates/app/api/v1/teams/[teamId]/route.ts +322 -0
- package/templates/app/api/v1/teams/[teamId]/subscription/route.ts +50 -0
- package/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +91 -0
- package/templates/app/api/v1/teams/docs.md +320 -0
- package/templates/app/api/v1/teams/presets.ts +178 -0
- package/templates/app/api/v1/teams/route.ts +293 -0
- package/templates/app/api/v1/teams/switch/route.ts +88 -0
- package/templates/app/api/v1/theme/[...path]/route.ts +361 -0
- package/templates/app/api/v1/theme/docs.md +74 -0
- package/templates/app/api/v1/theme/presets.ts +21 -0
- package/templates/app/api/v1/theme/route.ts +96 -0
- package/templates/app/api/v1/users/[id]/meta/[key]/route.ts +363 -0
- package/templates/app/api/v1/users/[id]/route.ts +302 -0
- package/templates/app/api/v1/users/docs.md +93 -0
- package/templates/app/api/v1/users/presets.ts +59 -0
- package/templates/app/api/v1/users/route.ts +197 -0
- package/templates/app/dashboard/(main)/[entity]/[id]/edit/page.tsx +117 -0
- package/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +103 -0
- package/templates/app/dashboard/(main)/[entity]/create/page.tsx +95 -0
- package/templates/app/dashboard/(main)/[entity]/error.tsx +51 -0
- package/templates/app/dashboard/(main)/[entity]/layout.tsx +113 -0
- package/templates/app/dashboard/(main)/[entity]/loading.tsx +61 -0
- package/templates/app/dashboard/(main)/[entity]/page.tsx +90 -0
- package/templates/app/dashboard/(main)/layout.tsx +98 -0
- package/templates/app/dashboard/(main)/loading.tsx +5 -0
- package/templates/app/dashboard/(main)/page.tsx +201 -0
- package/templates/app/dashboard/(main)/patterns/[id]/edit/page.tsx +114 -0
- package/templates/app/dashboard/(main)/patterns/[id]/page.tsx +20 -0
- package/templates/app/dashboard/(main)/patterns/[id]/reports/page.tsx +171 -0
- package/templates/app/dashboard/(main)/patterns/create/page.tsx +86 -0
- package/templates/app/dashboard/(main)/patterns/page.tsx +444 -0
- package/templates/app/dashboard/features/analytics/page.tsx +35 -0
- package/templates/app/dashboard/features/automation/page.tsx +35 -0
- package/templates/app/dashboard/features/layout.tsx +13 -0
- package/templates/app/dashboard/features/loading.tsx +5 -0
- package/templates/app/dashboard/features/webhooks/page.tsx +35 -0
- package/templates/app/dashboard/layout.tsx +86 -0
- package/templates/app/dashboard/permission-denied/page.tsx +29 -0
- package/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
- package/templates/app/dashboard/settings/api-keys/page.tsx +513 -0
- package/templates/app/dashboard/settings/billing/loading.tsx +5 -0
- package/templates/app/dashboard/settings/billing/page.tsx +284 -0
- package/templates/app/dashboard/settings/invoices/[invoiceNumber]/page.tsx +222 -0
- package/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
- package/templates/app/dashboard/settings/invoices/page.tsx +82 -0
- package/templates/app/dashboard/settings/layout.tsx +151 -0
- package/templates/app/dashboard/settings/loading.tsx +5 -0
- package/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
- package/templates/app/dashboard/settings/notifications/page.tsx +462 -0
- package/templates/app/dashboard/settings/page.tsx +92 -0
- package/templates/app/dashboard/settings/password/loading.tsx +5 -0
- package/templates/app/dashboard/settings/password/page.tsx +306 -0
- package/templates/app/dashboard/settings/plans/loading.tsx +5 -0
- package/templates/app/dashboard/settings/plans/page.tsx +40 -0
- package/templates/app/dashboard/settings/profile/loading.tsx +5 -0
- package/templates/app/dashboard/settings/profile/page.tsx +686 -0
- package/templates/app/dashboard/settings/security/loading.tsx +5 -0
- package/templates/app/dashboard/settings/security/page.tsx +505 -0
- package/templates/app/dashboard/settings/teams/loading.tsx +5 -0
- package/templates/app/dashboard/settings/teams/page.tsx +272 -0
- package/templates/app/dashboard/settings/teams/permissions/page.tsx +92 -0
- package/templates/app/devtools/blocks/[slug]/page.tsx +39 -0
- package/templates/app/devtools/blocks/page.tsx +31 -0
- package/templates/app/devtools/config/page.tsx +31 -0
- package/templates/app/devtools/features/page.tsx +31 -0
- package/templates/app/devtools/flows/page.tsx +31 -0
- package/templates/app/devtools/layout.tsx +58 -0
- package/templates/app/devtools/page.tsx +121 -0
- package/templates/app/devtools/scheduled-actions/page.tsx +157 -0
- package/templates/app/devtools/style/page.tsx +330 -0
- package/templates/app/devtools/tags/page.tsx +31 -0
- package/templates/app/devtools/tests/[[...path]]/page.tsx +47 -0
- package/templates/app/favicon.ico +0 -0
- package/templates/app/globals.css +12 -0
- package/templates/app/layout.tsx +96 -0
- package/templates/app/public/page.tsx +30 -0
- package/templates/app/superadmin/docs/[section]/[page]/page.tsx +92 -0
- package/templates/app/superadmin/docs/page.tsx +75 -0
- package/templates/app/superadmin/layout.tsx +67 -0
- package/templates/app/superadmin/page.tsx +149 -0
- package/templates/app/superadmin/subscriptions/page.tsx +655 -0
- package/templates/app/superadmin/team-roles/page.tsx +493 -0
- package/templates/app/superadmin/teams/[teamId]/page.tsx +687 -0
- package/templates/app/superadmin/teams/page.tsx +302 -0
- package/templates/app/superadmin/users/[userId]/page.tsx +548 -0
- package/templates/app/superadmin/users/page.tsx +528 -0
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { useParams } from "next/navigation";
|
|
5
|
+
import { format } from "date-fns";
|
|
6
|
+
import {
|
|
7
|
+
Card,
|
|
8
|
+
CardContent,
|
|
9
|
+
CardDescription,
|
|
10
|
+
CardHeader,
|
|
11
|
+
CardTitle,
|
|
12
|
+
} from "@nextsparkjs/core/components/ui/card";
|
|
13
|
+
import { Button } from "@nextsparkjs/core/components/ui/button";
|
|
14
|
+
import { Badge } from "@nextsparkjs/core/components/ui/badge";
|
|
15
|
+
import { Avatar, AvatarFallback } from "@nextsparkjs/core/components/ui/avatar";
|
|
16
|
+
import {
|
|
17
|
+
Table,
|
|
18
|
+
TableBody,
|
|
19
|
+
TableCell,
|
|
20
|
+
TableHead,
|
|
21
|
+
TableHeader,
|
|
22
|
+
TableRow,
|
|
23
|
+
} from "@nextsparkjs/core/components/ui/table";
|
|
24
|
+
import {
|
|
25
|
+
ArrowLeft,
|
|
26
|
+
Users2,
|
|
27
|
+
User,
|
|
28
|
+
Calendar,
|
|
29
|
+
Loader2,
|
|
30
|
+
AlertTriangle,
|
|
31
|
+
RefreshCw,
|
|
32
|
+
Crown,
|
|
33
|
+
Shield,
|
|
34
|
+
Eye,
|
|
35
|
+
Mail,
|
|
36
|
+
CheckCircle2,
|
|
37
|
+
XCircle,
|
|
38
|
+
Database,
|
|
39
|
+
} from "lucide-react";
|
|
40
|
+
import Link from "next/link";
|
|
41
|
+
import { getTemplateOrDefaultClient } from "@nextsparkjs/registries/template-registry.client";
|
|
42
|
+
|
|
43
|
+
interface TeamMembership {
|
|
44
|
+
teamId: string;
|
|
45
|
+
teamName: string;
|
|
46
|
+
role: "owner" | "admin" | "member" | "viewer";
|
|
47
|
+
joinedAt: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface UserMeta {
|
|
51
|
+
id: string;
|
|
52
|
+
metaKey: string;
|
|
53
|
+
metaValue: unknown;
|
|
54
|
+
dataType: string | null;
|
|
55
|
+
isPublic: boolean;
|
|
56
|
+
isSearchable: boolean;
|
|
57
|
+
createdAt: string;
|
|
58
|
+
updatedAt: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface UserDetail {
|
|
62
|
+
id: string;
|
|
63
|
+
firstName: string;
|
|
64
|
+
lastName: string;
|
|
65
|
+
fullName: string;
|
|
66
|
+
email: string;
|
|
67
|
+
role: string;
|
|
68
|
+
emailVerified: boolean;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
updatedAt: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface UserDetailData {
|
|
74
|
+
user: UserDetail;
|
|
75
|
+
teams: TeamMembership[];
|
|
76
|
+
userMetas: UserMeta[];
|
|
77
|
+
stats: {
|
|
78
|
+
totalTeams: number;
|
|
79
|
+
workTeams: number;
|
|
80
|
+
personalTeams: number;
|
|
81
|
+
ownedTeams: number;
|
|
82
|
+
};
|
|
83
|
+
metadata: {
|
|
84
|
+
requestedBy: string;
|
|
85
|
+
requestedAt: string;
|
|
86
|
+
source: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const roleIcons = {
|
|
91
|
+
owner: Crown,
|
|
92
|
+
admin: Shield,
|
|
93
|
+
member: User,
|
|
94
|
+
viewer: Eye,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const roleColors = {
|
|
98
|
+
owner: "destructive",
|
|
99
|
+
admin: "default",
|
|
100
|
+
member: "secondary",
|
|
101
|
+
viewer: "outline",
|
|
102
|
+
} as const;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* User Detail Page
|
|
106
|
+
*
|
|
107
|
+
* Displays detailed information about a specific user for superadmins.
|
|
108
|
+
*/
|
|
109
|
+
function UserDetailPage() {
|
|
110
|
+
const params = useParams();
|
|
111
|
+
const userId = params.userId as string;
|
|
112
|
+
|
|
113
|
+
// Fetch user data from API
|
|
114
|
+
const { data: userData, isLoading, error, refetch } = useQuery<UserDetailData>({
|
|
115
|
+
queryKey: ["superadmin-user", userId],
|
|
116
|
+
queryFn: async () => {
|
|
117
|
+
const response = await fetch(`/api/superadmin/users/${userId}`);
|
|
118
|
+
if (!response.ok) {
|
|
119
|
+
if (response.status === 404) {
|
|
120
|
+
throw new Error("User not found");
|
|
121
|
+
}
|
|
122
|
+
throw new Error("Failed to fetch user data");
|
|
123
|
+
}
|
|
124
|
+
return response.json();
|
|
125
|
+
},
|
|
126
|
+
retry: 2,
|
|
127
|
+
staleTime: 30000,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// Get user initials for avatar
|
|
131
|
+
const getUserInitials = (firstName: string, lastName: string, email: string) => {
|
|
132
|
+
if (firstName && lastName) {
|
|
133
|
+
return `${firstName[0]}${lastName[0]}`.toUpperCase();
|
|
134
|
+
}
|
|
135
|
+
if (firstName) {
|
|
136
|
+
return firstName.slice(0, 2).toUpperCase();
|
|
137
|
+
}
|
|
138
|
+
return email.slice(0, 2).toUpperCase();
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Loading state
|
|
142
|
+
if (isLoading) {
|
|
143
|
+
return (
|
|
144
|
+
<div className="space-y-6">
|
|
145
|
+
<div className="flex items-center gap-4">
|
|
146
|
+
<Button variant="outline" size="sm" asChild>
|
|
147
|
+
<Link href="/superadmin/users" className="flex items-center gap-2">
|
|
148
|
+
<ArrowLeft className="h-4 w-4" />
|
|
149
|
+
Back to Users
|
|
150
|
+
</Link>
|
|
151
|
+
</Button>
|
|
152
|
+
<div>
|
|
153
|
+
<h1 className="text-3xl font-bold tracking-tight">User Details</h1>
|
|
154
|
+
<p className="text-muted-foreground">Loading user data...</p>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<div className="flex items-center justify-center py-12">
|
|
159
|
+
<Loader2 className="h-8 w-8 animate-spin" />
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Error state
|
|
166
|
+
if (error) {
|
|
167
|
+
return (
|
|
168
|
+
<div className="space-y-6">
|
|
169
|
+
<div className="flex items-center gap-4">
|
|
170
|
+
<Button variant="outline" size="sm" asChild>
|
|
171
|
+
<Link href="/superadmin/users" className="flex items-center gap-2">
|
|
172
|
+
<ArrowLeft className="h-4 w-4" />
|
|
173
|
+
Back to Users
|
|
174
|
+
</Link>
|
|
175
|
+
</Button>
|
|
176
|
+
<div>
|
|
177
|
+
<h1 className="text-3xl font-bold tracking-tight">User Details</h1>
|
|
178
|
+
<p className="text-muted-foreground">Error loading data</p>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<Card>
|
|
183
|
+
<CardHeader>
|
|
184
|
+
<CardTitle className="flex items-center gap-2">
|
|
185
|
+
<AlertTriangle className="h-5 w-5 text-destructive" />
|
|
186
|
+
Error Loading User
|
|
187
|
+
</CardTitle>
|
|
188
|
+
<CardDescription>
|
|
189
|
+
{error instanceof Error ? error.message : "Failed to load user data"}
|
|
190
|
+
</CardDescription>
|
|
191
|
+
</CardHeader>
|
|
192
|
+
<CardContent>
|
|
193
|
+
<Button
|
|
194
|
+
onClick={() => refetch()}
|
|
195
|
+
variant="outline"
|
|
196
|
+
className="flex items-center gap-2"
|
|
197
|
+
>
|
|
198
|
+
<RefreshCw className="h-4 w-4" />
|
|
199
|
+
Retry
|
|
200
|
+
</Button>
|
|
201
|
+
</CardContent>
|
|
202
|
+
</Card>
|
|
203
|
+
</div>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const user = userData?.user;
|
|
208
|
+
const teams = userData?.teams || [];
|
|
209
|
+
const userMetas = userData?.userMetas || [];
|
|
210
|
+
const stats = userData?.stats;
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<div className="space-y-6">
|
|
214
|
+
{/* Header */}
|
|
215
|
+
<div className="flex items-center gap-4">
|
|
216
|
+
<Button variant="outline" size="sm" asChild>
|
|
217
|
+
<Link href="/superadmin/users" className="flex items-center gap-2">
|
|
218
|
+
<ArrowLeft className="h-4 w-4" />
|
|
219
|
+
Back to Users
|
|
220
|
+
</Link>
|
|
221
|
+
</Button>
|
|
222
|
+
<div className="flex-1">
|
|
223
|
+
<h1 className="text-3xl font-bold tracking-tight">User Details</h1>
|
|
224
|
+
<p className="text-muted-foreground">
|
|
225
|
+
View user information and team memberships
|
|
226
|
+
</p>
|
|
227
|
+
</div>
|
|
228
|
+
<Button
|
|
229
|
+
onClick={() => refetch()}
|
|
230
|
+
variant="outline"
|
|
231
|
+
size="sm"
|
|
232
|
+
className="flex items-center gap-2"
|
|
233
|
+
>
|
|
234
|
+
<RefreshCw className="h-4 w-4" />
|
|
235
|
+
Refresh
|
|
236
|
+
</Button>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
{/* User Info Card */}
|
|
240
|
+
<Card>
|
|
241
|
+
<CardHeader>
|
|
242
|
+
<div className="flex items-start gap-4">
|
|
243
|
+
<Avatar className="h-16 w-16">
|
|
244
|
+
<AvatarFallback
|
|
245
|
+
className={
|
|
246
|
+
user?.role === "superadmin"
|
|
247
|
+
? "bg-red-100 text-red-700 text-xl"
|
|
248
|
+
: "bg-primary/10 text-primary text-xl"
|
|
249
|
+
}
|
|
250
|
+
>
|
|
251
|
+
{user
|
|
252
|
+
? getUserInitials(user.firstName, user.lastName, user.email)
|
|
253
|
+
: "??"}
|
|
254
|
+
</AvatarFallback>
|
|
255
|
+
</Avatar>
|
|
256
|
+
<div className="flex-1">
|
|
257
|
+
<div className="flex items-center gap-3">
|
|
258
|
+
<CardTitle className="text-2xl">{user?.fullName}</CardTitle>
|
|
259
|
+
<Badge
|
|
260
|
+
variant={user?.role === "superadmin" ? "destructive" : "secondary"}
|
|
261
|
+
>
|
|
262
|
+
{user?.role === "superadmin" ? (
|
|
263
|
+
<>
|
|
264
|
+
<Shield className="h-3 w-3 mr-1" />
|
|
265
|
+
Superadmin
|
|
266
|
+
</>
|
|
267
|
+
) : (
|
|
268
|
+
<>
|
|
269
|
+
<User className="h-3 w-3 mr-1" />
|
|
270
|
+
{user?.role || "User"}
|
|
271
|
+
</>
|
|
272
|
+
)}
|
|
273
|
+
</Badge>
|
|
274
|
+
<Badge
|
|
275
|
+
variant={user?.emailVerified ? "default" : "outline"}
|
|
276
|
+
className={user?.emailVerified ? "bg-green-100 text-green-700" : ""}
|
|
277
|
+
>
|
|
278
|
+
{user?.emailVerified ? (
|
|
279
|
+
<>
|
|
280
|
+
<CheckCircle2 className="h-3 w-3 mr-1" />
|
|
281
|
+
Verified
|
|
282
|
+
</>
|
|
283
|
+
) : (
|
|
284
|
+
<>
|
|
285
|
+
<XCircle className="h-3 w-3 mr-1" />
|
|
286
|
+
Unverified
|
|
287
|
+
</>
|
|
288
|
+
)}
|
|
289
|
+
</Badge>
|
|
290
|
+
</div>
|
|
291
|
+
<CardDescription className="mt-1">ID: {user?.id}</CardDescription>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</CardHeader>
|
|
295
|
+
<CardContent>
|
|
296
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
297
|
+
{/* Email */}
|
|
298
|
+
<div>
|
|
299
|
+
<h4 className="text-sm font-medium text-muted-foreground mb-2">
|
|
300
|
+
Email
|
|
301
|
+
</h4>
|
|
302
|
+
<div className="flex items-center gap-2">
|
|
303
|
+
<Mail className="h-5 w-5 text-muted-foreground" />
|
|
304
|
+
<span className="font-mono text-sm">{user?.email}</span>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
{/* Registered */}
|
|
309
|
+
<div>
|
|
310
|
+
<h4 className="text-sm font-medium text-muted-foreground mb-2">
|
|
311
|
+
Registered
|
|
312
|
+
</h4>
|
|
313
|
+
<div className="flex items-center gap-2 text-muted-foreground">
|
|
314
|
+
<Calendar className="h-5 w-5" />
|
|
315
|
+
<span>
|
|
316
|
+
{user?.createdAt
|
|
317
|
+
? format(new Date(user.createdAt), "MMMM dd, yyyy")
|
|
318
|
+
: "Unknown"}
|
|
319
|
+
</span>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
|
|
323
|
+
{/* Last Updated */}
|
|
324
|
+
<div>
|
|
325
|
+
<h4 className="text-sm font-medium text-muted-foreground mb-2">
|
|
326
|
+
Last Updated
|
|
327
|
+
</h4>
|
|
328
|
+
<div className="flex items-center gap-2 text-muted-foreground">
|
|
329
|
+
<Calendar className="h-5 w-5" />
|
|
330
|
+
<span>
|
|
331
|
+
{user?.updatedAt
|
|
332
|
+
? format(new Date(user.updatedAt), "MMMM dd, yyyy")
|
|
333
|
+
: "Unknown"}
|
|
334
|
+
</span>
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
</CardContent>
|
|
339
|
+
</Card>
|
|
340
|
+
|
|
341
|
+
{/* Stats Cards */}
|
|
342
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
343
|
+
<Card>
|
|
344
|
+
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
|
345
|
+
<CardTitle className="text-sm font-medium">Total Teams</CardTitle>
|
|
346
|
+
<Users2 className="h-4 w-4 text-muted-foreground" />
|
|
347
|
+
</CardHeader>
|
|
348
|
+
<CardContent>
|
|
349
|
+
<div className="text-2xl font-bold">{stats?.totalTeams || 0}</div>
|
|
350
|
+
<p className="text-xs text-muted-foreground">All team memberships</p>
|
|
351
|
+
</CardContent>
|
|
352
|
+
</Card>
|
|
353
|
+
|
|
354
|
+
<Card>
|
|
355
|
+
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
|
356
|
+
<CardTitle className="text-sm font-medium">Owned Teams</CardTitle>
|
|
357
|
+
<Crown className="h-4 w-4 text-yellow-600" />
|
|
358
|
+
</CardHeader>
|
|
359
|
+
<CardContent>
|
|
360
|
+
<div className="text-2xl font-bold text-yellow-600">
|
|
361
|
+
{stats?.ownedTeams || 0}
|
|
362
|
+
</div>
|
|
363
|
+
<p className="text-xs text-muted-foreground">As team owner</p>
|
|
364
|
+
</CardContent>
|
|
365
|
+
</Card>
|
|
366
|
+
</div>
|
|
367
|
+
|
|
368
|
+
{/* Team Memberships Table */}
|
|
369
|
+
<Card>
|
|
370
|
+
<CardHeader>
|
|
371
|
+
<CardTitle className="flex items-center gap-2">
|
|
372
|
+
<Users2 className="h-5 w-5" />
|
|
373
|
+
Team Memberships ({teams.length})
|
|
374
|
+
</CardTitle>
|
|
375
|
+
<CardDescription>
|
|
376
|
+
All teams this user belongs to and their roles.
|
|
377
|
+
</CardDescription>
|
|
378
|
+
</CardHeader>
|
|
379
|
+
<CardContent>
|
|
380
|
+
{teams.length === 0 ? (
|
|
381
|
+
<div className="text-center py-8">
|
|
382
|
+
<Users2 className="mx-auto h-12 w-12 text-muted-foreground" />
|
|
383
|
+
<h3 className="mt-4 text-lg font-medium">No team memberships</h3>
|
|
384
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
385
|
+
This user is not a member of any teams yet.
|
|
386
|
+
</p>
|
|
387
|
+
</div>
|
|
388
|
+
) : (
|
|
389
|
+
<div className="rounded-md border">
|
|
390
|
+
<Table>
|
|
391
|
+
<TableHeader>
|
|
392
|
+
<TableRow>
|
|
393
|
+
<TableHead>Team</TableHead>
|
|
394
|
+
<TableHead>Role</TableHead>
|
|
395
|
+
<TableHead>Joined</TableHead>
|
|
396
|
+
<TableHead className="w-[80px]">Actions</TableHead>
|
|
397
|
+
</TableRow>
|
|
398
|
+
</TableHeader>
|
|
399
|
+
<TableBody>
|
|
400
|
+
{teams.map((team) => {
|
|
401
|
+
const RoleIcon = roleIcons[team.role] || User;
|
|
402
|
+
return (
|
|
403
|
+
<TableRow key={team.teamId}>
|
|
404
|
+
<TableCell>
|
|
405
|
+
<div className="font-medium">{team.teamName}</div>
|
|
406
|
+
</TableCell>
|
|
407
|
+
<TableCell>
|
|
408
|
+
<Badge variant={roleColors[team.role]} className="gap-1">
|
|
409
|
+
<RoleIcon className="h-3 w-3" />
|
|
410
|
+
{team.role.charAt(0).toUpperCase() + team.role.slice(1)}
|
|
411
|
+
</Badge>
|
|
412
|
+
</TableCell>
|
|
413
|
+
<TableCell>
|
|
414
|
+
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
415
|
+
<Calendar className="h-4 w-4" />
|
|
416
|
+
{team.joinedAt
|
|
417
|
+
? format(new Date(team.joinedAt), "MMM dd, yyyy")
|
|
418
|
+
: "Unknown"}
|
|
419
|
+
</div>
|
|
420
|
+
</TableCell>
|
|
421
|
+
<TableCell>
|
|
422
|
+
<Button variant="ghost" size="sm" asChild>
|
|
423
|
+
<Link href={`/superadmin/teams/${team.teamId}`}>
|
|
424
|
+
View
|
|
425
|
+
</Link>
|
|
426
|
+
</Button>
|
|
427
|
+
</TableCell>
|
|
428
|
+
</TableRow>
|
|
429
|
+
);
|
|
430
|
+
})}
|
|
431
|
+
</TableBody>
|
|
432
|
+
</Table>
|
|
433
|
+
</div>
|
|
434
|
+
)}
|
|
435
|
+
</CardContent>
|
|
436
|
+
</Card>
|
|
437
|
+
|
|
438
|
+
{/* User Metadata Card */}
|
|
439
|
+
<Card data-cy="superadmin-user-metas">
|
|
440
|
+
<CardHeader>
|
|
441
|
+
<CardTitle className="flex items-center gap-2" data-cy="superadmin-user-metas-title">
|
|
442
|
+
<Database className="h-5 w-5" />
|
|
443
|
+
User Metadata ({userMetas.length})
|
|
444
|
+
</CardTitle>
|
|
445
|
+
<CardDescription>
|
|
446
|
+
All metadata records stored for this user.
|
|
447
|
+
</CardDescription>
|
|
448
|
+
</CardHeader>
|
|
449
|
+
<CardContent>
|
|
450
|
+
{userMetas.length === 0 ? (
|
|
451
|
+
<div className="text-center py-8" data-cy="superadmin-user-metas-empty">
|
|
452
|
+
<Database className="mx-auto h-12 w-12 text-muted-foreground" />
|
|
453
|
+
<h3 className="mt-4 text-lg font-medium">No metadata</h3>
|
|
454
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
455
|
+
This user has no metadata records yet.
|
|
456
|
+
</p>
|
|
457
|
+
</div>
|
|
458
|
+
) : (
|
|
459
|
+
<div className="rounded-md border">
|
|
460
|
+
<Table data-cy="superadmin-user-metas-table">
|
|
461
|
+
<TableHeader>
|
|
462
|
+
<TableRow>
|
|
463
|
+
<TableHead>Key</TableHead>
|
|
464
|
+
<TableHead>Value</TableHead>
|
|
465
|
+
<TableHead>Type</TableHead>
|
|
466
|
+
<TableHead>Public</TableHead>
|
|
467
|
+
<TableHead>Searchable</TableHead>
|
|
468
|
+
<TableHead>Updated</TableHead>
|
|
469
|
+
</TableRow>
|
|
470
|
+
</TableHeader>
|
|
471
|
+
<TableBody>
|
|
472
|
+
{userMetas.map((meta) => (
|
|
473
|
+
<TableRow key={meta.id} data-cy={`superadmin-user-meta-row-${meta.metaKey}`}>
|
|
474
|
+
<TableCell>
|
|
475
|
+
<code className="text-sm bg-muted px-1.5 py-0.5 rounded" data-cy={`superadmin-user-meta-key-${meta.metaKey}`}>
|
|
476
|
+
{meta.metaKey}
|
|
477
|
+
</code>
|
|
478
|
+
</TableCell>
|
|
479
|
+
<TableCell className="max-w-xs">
|
|
480
|
+
<pre className="text-xs bg-muted p-2 rounded overflow-auto max-h-20" data-cy={`superadmin-user-meta-value-${meta.metaKey}`}>
|
|
481
|
+
{typeof meta.metaValue === "object"
|
|
482
|
+
? JSON.stringify(meta.metaValue, null, 2)
|
|
483
|
+
: String(meta.metaValue)}
|
|
484
|
+
</pre>
|
|
485
|
+
</TableCell>
|
|
486
|
+
<TableCell>
|
|
487
|
+
<Badge variant="outline" className="text-xs" data-cy={`superadmin-user-meta-type-${meta.metaKey}`}>
|
|
488
|
+
{meta.dataType || "json"}
|
|
489
|
+
</Badge>
|
|
490
|
+
</TableCell>
|
|
491
|
+
<TableCell>
|
|
492
|
+
{meta.isPublic ? (
|
|
493
|
+
<Badge variant="default" className="bg-green-100 text-green-700" data-cy={`superadmin-user-meta-public-${meta.metaKey}`}>
|
|
494
|
+
Yes
|
|
495
|
+
</Badge>
|
|
496
|
+
) : (
|
|
497
|
+
<Badge variant="secondary" data-cy={`superadmin-user-meta-public-${meta.metaKey}`}>No</Badge>
|
|
498
|
+
)}
|
|
499
|
+
</TableCell>
|
|
500
|
+
<TableCell>
|
|
501
|
+
{meta.isSearchable ? (
|
|
502
|
+
<Badge variant="default" className="bg-blue-100 text-blue-700" data-cy={`superadmin-user-meta-searchable-${meta.metaKey}`}>
|
|
503
|
+
Yes
|
|
504
|
+
</Badge>
|
|
505
|
+
) : (
|
|
506
|
+
<Badge variant="secondary" data-cy={`superadmin-user-meta-searchable-${meta.metaKey}`}>No</Badge>
|
|
507
|
+
)}
|
|
508
|
+
</TableCell>
|
|
509
|
+
<TableCell>
|
|
510
|
+
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
511
|
+
<Calendar className="h-4 w-4" />
|
|
512
|
+
{meta.updatedAt
|
|
513
|
+
? format(new Date(meta.updatedAt), "MMM dd, yyyy")
|
|
514
|
+
: "Unknown"}
|
|
515
|
+
</div>
|
|
516
|
+
</TableCell>
|
|
517
|
+
</TableRow>
|
|
518
|
+
))}
|
|
519
|
+
</TableBody>
|
|
520
|
+
</Table>
|
|
521
|
+
</div>
|
|
522
|
+
)}
|
|
523
|
+
</CardContent>
|
|
524
|
+
</Card>
|
|
525
|
+
|
|
526
|
+
{/* Metadata Footer */}
|
|
527
|
+
{userData?.metadata && (
|
|
528
|
+
<Card className="bg-muted/30">
|
|
529
|
+
<CardContent className="pt-4">
|
|
530
|
+
<div className="text-xs text-muted-foreground space-y-1">
|
|
531
|
+
<p>
|
|
532
|
+
Last updated:{" "}
|
|
533
|
+
{new Date(userData.metadata.requestedAt).toLocaleString()}
|
|
534
|
+
</p>
|
|
535
|
+
<p>Requested by: {userData.metadata.requestedBy}</p>
|
|
536
|
+
<p>Source: {userData.metadata.source}</p>
|
|
537
|
+
</div>
|
|
538
|
+
</CardContent>
|
|
539
|
+
</Card>
|
|
540
|
+
)}
|
|
541
|
+
</div>
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export default getTemplateOrDefaultClient(
|
|
546
|
+
"app/superadmin/users/[userId]/page.tsx",
|
|
547
|
+
UserDetailPage
|
|
548
|
+
);
|