feat(admin): pass current page title from server to AdminTop via props
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user