7ef37e3ebd
- Prefix feature exports with `features/` (auth, admin, provider) - Prefix shared exports with `shared/` (components, icons, lib, config, logger, rate-limit) - Add new explicit exports for `shared/logger`, `shared/config`, and `shared/rate-limit` - Update internal imports to use package self-referencing (`@zen/core/shared/*`) instead of relative paths
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
/**
|
|
* Admin Page - Server Component Wrapper for Next.js App Router
|
|
*
|
|
* Re-export this in your app/admin/[...admin]/page.js:
|
|
* export { default } from '@zen/core/features/admin/page';
|
|
*/
|
|
|
|
import { AdminPagesLayout, AdminPagesClient } from '@zen/core/features/admin/pages';
|
|
import { protectAdmin } from '@zen/core/features/admin';
|
|
import { buildNavigationSections } from '@zen/core/features/admin/navigation';
|
|
import { getDashboardStats } from '@zen/core/features/admin/actions';
|
|
import { logoutAction } from '@zen/core/features/auth/actions';
|
|
import { getAppName } from '@zen/core';
|
|
|
|
export default async function AdminPage({ params }) {
|
|
const resolvedParams = await params;
|
|
const session = await protectAdmin();
|
|
const appName = getAppName();
|
|
|
|
const statsResult = await getDashboardStats();
|
|
const dashboardStats = statsResult.success ? statsResult.stats : null;
|
|
|
|
const navigationSections = buildNavigationSections('/');
|
|
|
|
return (
|
|
<AdminPagesLayout
|
|
user={session.user}
|
|
onLogout={logoutAction}
|
|
appName={appName}
|
|
navigationSections={navigationSections}
|
|
>
|
|
<AdminPagesClient
|
|
params={resolvedParams}
|
|
user={session.user}
|
|
dashboardStats={dashboardStats}
|
|
/>
|
|
</AdminPagesLayout>
|
|
);
|
|
}
|