feat(core)!: introduce runtime extension registry and flat module conventions
BREAKING CHANGE: sup config now derives entries from package.json#exports and a server/client glob instead of manual lists; module structure follows flat + barrel convention with .server.js/.client.js runtime suffixes
This commit is contained in:
@@ -1,38 +1,32 @@
|
||||
/**
|
||||
* 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 { collectAllDashboardData } from './dashboard/serverRegistry.js';
|
||||
import AdminShell from './components/AdminShell.js';
|
||||
import AdminPageClient from './AdminPage.client.js';
|
||||
import { protectAdmin } from './protect.js';
|
||||
import { buildNavigationSections } from './navigation.js';
|
||||
import { collectWidgetData } from './registry.js';
|
||||
import { logoutAction } from '@zen/core/features/auth/actions';
|
||||
import { getAppName } from '@zen/core';
|
||||
import './widgets/index.server.js';
|
||||
|
||||
export default async function AdminPage({ params }) {
|
||||
const resolvedParams = await params;
|
||||
const session = await protectAdmin();
|
||||
const appName = getAppName();
|
||||
|
||||
const dashboardStats = await collectAllDashboardData();
|
||||
|
||||
const widgetData = await collectWidgetData();
|
||||
const navigationSections = buildNavigationSections('/');
|
||||
|
||||
return (
|
||||
<AdminPagesLayout
|
||||
<AdminShell
|
||||
user={session.user}
|
||||
onLogout={logoutAction}
|
||||
appName={appName}
|
||||
navigationSections={navigationSections}
|
||||
>
|
||||
<AdminPagesClient
|
||||
<AdminPageClient
|
||||
params={resolvedParams}
|
||||
user={session.user}
|
||||
dashboardStats={dashboardStats}
|
||||
widgetData={widgetData}
|
||||
/>
|
||||
</AdminPagesLayout>
|
||||
</AdminShell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user