32 lines
692 B
TypeScript
32 lines
692 B
TypeScript
import { type ReactNode } from 'react';
|
|
import config from '@payload-config';
|
|
import { type ServerFunctionClientArgs } from 'payload';
|
|
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts';
|
|
import { importMap } from './admin/importMap';
|
|
import '@payloadcms/next/css';
|
|
|
|
type Props = Readonly<{
|
|
children: ReactNode;
|
|
}>;
|
|
|
|
async function serverFunction(args: ServerFunctionClientArgs) {
|
|
'use server';
|
|
|
|
return handleServerFunctions({
|
|
...args,
|
|
config,
|
|
importMap
|
|
});
|
|
}
|
|
|
|
export default function Layout({ children }: Props) {
|
|
return (
|
|
<RootLayout
|
|
config={config}
|
|
importMap={importMap}
|
|
serverFunction={serverFunction}
|
|
>
|
|
{children}
|
|
</RootLayout>
|
|
);
|
|
} |