Fix params/searchParams types for Next.js app router
This commit is contained in:
23
app/(payload)/layout.tsx
Normal file
23
app/(payload)/layout.tsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { RootLayout, handleServerFunctions } from '@payloadcms/next/layouts';
|
||||||
|
import type { ServerFunctionClient } from 'payload';
|
||||||
|
import React from 'react';
|
||||||
|
import config from '../../payload.config';
|
||||||
|
import { importMap } from './gestion59/importMap';
|
||||||
|
|
||||||
|
export default function AdminLayout({ children }: { children: React.ReactNode }) {
|
||||||
|
const serverFunction: ServerFunctionClient = async (args) => {
|
||||||
|
'use server';
|
||||||
|
return handleServerFunctions({
|
||||||
|
...args,
|
||||||
|
config,
|
||||||
|
importMap,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return RootLayout({
|
||||||
|
config,
|
||||||
|
importMap,
|
||||||
|
serverFunction,
|
||||||
|
children,
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user