Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 4s
Build & Deploy / 🧪 QA (push) Successful in 2m55s
Build & Deploy / 🏗️ Build (push) Successful in 11m40s
Build & Deploy / 🚀 Deploy (push) Failing after 8s
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
37 lines
814 B
TypeScript
37 lines
814 B
TypeScript
import configPromise from "@payload-config";
|
|
import { RootLayout } from "@payloadcms/next/layouts";
|
|
import React from "react";
|
|
|
|
import "@payloadcms/next/css";
|
|
import "./custom.scss";
|
|
import { handleServerFunctions } from "@payloadcms/next/layouts";
|
|
import { importMap } from "./admin/importMap";
|
|
|
|
type Args = {
|
|
children: React.ReactNode;
|
|
};
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
const serverFunction: any = async function (args: any) {
|
|
"use server";
|
|
return handleServerFunctions({
|
|
...args,
|
|
config: configPromise,
|
|
importMap,
|
|
});
|
|
};
|
|
|
|
const Layout = ({ children }: Args) => {
|
|
return (
|
|
<RootLayout
|
|
config={configPromise}
|
|
importMap={importMap}
|
|
serverFunction={serverFunction}
|
|
>
|
|
{children}
|
|
</RootLayout>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|