fix(cms): import CSS from @payloadcms/next/css, use handleServerFunctions from layouts

This commit is contained in:
2026-04-06 15:45:55 +02:00
parent ddd1a546f7
commit 575770e142

View File

@@ -1,9 +1,11 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import type { ServerFunctionClient } from "payload";
import "@payloadcms/next/css";
import config from "@payload-config";
import { RootLayout } from "@payloadcms/next/layouts";
import {
RootLayout,
handleServerFunctions,
} from "@payloadcms/next/layouts";
import React from "react";
import { importMap } from "./importMap";
@@ -13,10 +15,9 @@ type Args = {
children: React.ReactNode;
};
const serverFunction: ServerFunctionClient = async function (args) {
const serverFunction: typeof handleServerFunctions = async (args) => {
"use server";
const { default: payloadModule } = await import("payload");
return payloadModule.handleServerFunctions({ ...args, config, importMap });
return handleServerFunctions({ ...args, config, importMap });
};
const Layout = ({ children }: Args) => (