fix(cms): import CSS from @payloadcms/next/css, use handleServerFunctions from layouts
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
||||||
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
|
/* 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 config from "@payload-config";
|
||||||
import { RootLayout } from "@payloadcms/next/layouts";
|
import {
|
||||||
|
RootLayout,
|
||||||
|
handleServerFunctions,
|
||||||
|
} from "@payloadcms/next/layouts";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { importMap } from "./importMap";
|
import { importMap } from "./importMap";
|
||||||
@@ -13,10 +15,9 @@ type Args = {
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
const serverFunction: ServerFunctionClient = async function (args) {
|
const serverFunction: typeof handleServerFunctions = async (args) => {
|
||||||
"use server";
|
"use server";
|
||||||
const { default: payloadModule } = await import("payload");
|
return handleServerFunctions({ ...args, config, importMap });
|
||||||
return payloadModule.handleServerFunctions({ ...args, config, importMap });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const Layout = ({ children }: Args) => (
|
const Layout = ({ children }: Args) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user