create-payload-app 3.0.0-canary.bda91d8 → 3.0.0-canary.be89809
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,8 @@
|
|
2
2
|
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
|
3
3
|
import config from '@payload-config'
|
4
4
|
import '@payloadcms/next/css'
|
5
|
-
import {
|
5
|
+
import type { ServerFunctionClient } from 'payload'
|
6
|
+
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts'
|
6
7
|
import React from 'react'
|
7
8
|
|
8
9
|
import { importMap } from './admin/importMap.js'
|
@@ -12,8 +13,17 @@ type Args = {
|
|
12
13
|
children: React.ReactNode
|
13
14
|
}
|
14
15
|
|
16
|
+
const serverFunction: ServerFunctionClient = async function (args) {
|
17
|
+
'use server'
|
18
|
+
return handleServerFunctions({
|
19
|
+
...args,
|
20
|
+
config,
|
21
|
+
importMap,
|
22
|
+
})
|
23
|
+
}
|
24
|
+
|
15
25
|
const Layout = ({ children }: Args) => (
|
16
|
-
<RootLayout config={config} importMap={importMap}>
|
26
|
+
<RootLayout config={config} importMap={importMap} serverFunction={serverFunction}>
|
17
27
|
{children}
|
18
28
|
</RootLayout>
|
19
29
|
)
|