diff --git a/apps/cms/src/app/(payload)/layout.tsx b/apps/cms/src/app/(payload)/layout.tsx index c78ffef..0eb1931 100644 --- a/apps/cms/src/app/(payload)/layout.tsx +++ b/apps/cms/src/app/(payload)/layout.tsx @@ -2,26 +2,17 @@ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import config from "@payload-config"; import "@payloadcms/next/css"; -import type { ServerFunctionClient } from "payload"; -import { handleServerFunctions, RootLayout } from "@payloadcms/next/layouts"; +import { RootLayout } from "@payloadcms/next/layouts"; import React from "react"; import { importMap } from "./admin/importMap.js"; +import { serverFunction } from "./serverFunction"; import "./custom.scss"; type Args = { children: React.ReactNode; }; -const serverFunction: ServerFunctionClient = async function (args) { - "use server"; - return handleServerFunctions({ - ...args, - config, - importMap, - }); -}; - const Layout = ({ children }: Args) => ( { + return handleServerFunctions({ + ...args, + config, + importMap, + }); +};