feat(admin): extract AdminLayout as a separate server component
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import AdminShell from './components/AdminShell.js';
|
||||
import { protectAdmin } from './protect.js';
|
||||
import { buildNavigationSections } from './navigation.js';
|
||||
import { logoutAction } from '@zen/core/features/auth/actions';
|
||||
import { getAppName } from '@zen/core';
|
||||
import './widgets/index.server.js';
|
||||
|
||||
export default async function AdminLayout({ children }) {
|
||||
const session = await protectAdmin();
|
||||
const appName = getAppName();
|
||||
const navigationSections = buildNavigationSections('/');
|
||||
|
||||
return (
|
||||
<AdminShell
|
||||
user={session.user}
|
||||
onLogout={logoutAction}
|
||||
appName={appName}
|
||||
navigationSections={navigationSections}
|
||||
>
|
||||
{children}
|
||||
</AdminShell>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user