/** * Root layout for the Payload admin panel. * * This is a SECOND root layout: it renders its own /, as does * app/(frontend)/layout.tsx. Next permits that only while no app/layout.tsx * exists — which is why the site's routes were moved into (frontend). Adding * an app/layout.tsx would nest the admin panel inside the site's nav, footer * and providers and emit nested . */ import type { ServerFunctionClient } from 'payload'; import config from '@payload-config'; import { RootLayout, handleServerFunctions } from '@payloadcms/next/layouts'; import { importMap } from './admin/importMap.js'; import '@payloadcms/next/css'; const serverFunction: ServerFunctionClient = async function (args) { 'use server'; return handleServerFunctions({ ...args, config, importMap }); }; export default function PayloadLayout({ children }: { children: React.ReactNode }) { return ( {children} ); }