diff --git a/app/(payload)/gestion59/[[...segments]]/page.tsx b/app/(payload)/gestion59/[[...segments]]/page.tsx index 43a8afd..0527fa8 100644 --- a/app/(payload)/gestion59/[[...segments]]/page.tsx +++ b/app/(payload)/gestion59/[[...segments]]/page.tsx @@ -1,25 +1,18 @@ import { RootPage, generatePageMetadata } from '@payloadcms/next/views'; +import type { Metadata } from 'next'; import config from '../../../../payload.config'; import { importMap } from '../importMap'; -export type PayloadRouteParams = { - segments?: string[]; -}; - -export type PayloadRouteSearchParams = { - [key: string]: string | string[] | undefined; -}; - type Props = { - params: PayloadRouteParams; - searchParams: PayloadRouteSearchParams; + params: Promise<{ segments?: string[] }>; + searchParams: Promise<{ [key: string]: string | string[] | undefined }>; }; -export const generateMetadata = (props: Props) => { +export const generateMetadata = (props: Props): Promise => { return generatePageMetadata({ config, - params: Promise.resolve(props.params) as Promise<{ [key: string]: string | string[] }>, - searchParams: Promise.resolve(props.searchParams) as Promise<{ [key: string]: string | string[] }>, + params: props.params as Promise<{ [key: string]: string | string[] }>, + searchParams: props.searchParams as Promise<{ [key: string]: string | string[] }>, }); }; @@ -27,7 +20,7 @@ export default function Page(props: Props) { return RootPage({ config, importMap, - params: Promise.resolve(props.params) as Promise<{ segments: string[] }>, - searchParams: Promise.resolve(props.searchParams) as Promise<{ [key: string]: string | string[] }>, + params: props.params as Promise<{ segments: string[] }>, + searchParams: props.searchParams as Promise<{ [key: string]: string | string[] }>, }); }