feat(admin): pass current page title from server to AdminTop via props

This commit is contained in:
2026-04-22 17:52:48 -04:00
parent c41172a397
commit 7c92f34245
3 changed files with 10 additions and 8 deletions
+4 -1
View File
@@ -2,7 +2,7 @@ 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 { collectWidgetData, getPage } from './registry.js';
import { logoutAction } from '@zen/core/features/auth/actions';
import { getAppName } from '@zen/core';
import './widgets/index.server.js';
@@ -14,6 +14,8 @@ export default async function AdminPage({ params }) {
const widgetData = await collectWidgetData();
const navigationSections = buildNavigationSections('/');
const slug = resolvedParams?.admin?.[0] || 'dashboard';
const currentPageTitle = getPage(slug)?.title;
return (
<AdminShell
@@ -21,6 +23,7 @@ export default async function AdminPage({ params }) {
onLogout={logoutAction}
appName={appName}
navigationSections={navigationSections}
currentPageTitle={currentPageTitle}
>
<AdminPageClient
params={resolvedParams}