diff --git a/src/app/(payload)/admin/(dashboard)/account/page.tsx b/src/app/(payload)/admin/(dashboard)/account/page.tsx index c17fe0a..53e0aa9 100644 --- a/src/app/(payload)/admin/(dashboard)/account/page.tsx +++ b/src/app/(payload)/admin/(dashboard)/account/page.tsx @@ -1,8 +1,14 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import { Account, generateMetadata as generateMeta } from '@payloadcms/next/pages/Account' +import { Account, generateMetadata as generateMeta } from '@payloadcms/next/pages/Account/index' import config from '@payload-config' export const generateMetadata = async () => generateMeta({ config }) -export default ({ searchParams }) => Account({ config, searchParams }) +type Args = { + searchParams: { [key: string]: string | string[] }; +} + +const Page: React.FC = ({ searchParams }) => Account({ config, searchParams }) + +export default Page diff --git a/src/app/(payload)/admin/(dashboard)/collections/[collection]/[...segments]/layout.tsx b/src/app/(payload)/admin/(dashboard)/collections/[collection]/[...segments]/layout.tsx index 1129ec4..2cf34c1 100644 --- a/src/app/(payload)/admin/(dashboard)/collections/[collection]/[...segments]/layout.tsx +++ b/src/app/(payload)/admin/(dashboard)/collections/[collection]/[...segments]/layout.tsx @@ -1,11 +1,20 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import React from 'react' -import { DocumentLayout } from '@payloadcms/next/layouts/Document' +import { DocumentLayout } from '@payloadcms/next/layouts/Document/index' import configPromise from '@payload-config' -export default async ({ children, params }: { children: React.ReactNode; params }) => ( +type Args = { + children: React.ReactNode + params: { + collection: string + } +} + +const Layout: React.FC = async ({ children, params }: Args) => ( {children} ) + +export default Layout diff --git a/src/app/(payload)/admin/(dashboard)/collections/[collection]/[...segments]/page.tsx b/src/app/(payload)/admin/(dashboard)/collections/[collection]/[...segments]/page.tsx index e11a1fc..9bf326f 100644 --- a/src/app/(payload)/admin/(dashboard)/collections/[collection]/[...segments]/page.tsx +++ b/src/app/(payload)/admin/(dashboard)/collections/[collection]/[...segments]/page.tsx @@ -1,13 +1,24 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import { Document, generateMetadata as generateMeta } from '@payloadcms/next/pages/Document' +import { Document, generateMetadata as generateMeta } from '@payloadcms/next/pages/Document/index' import config from '@payload-config' -export const generateMetadata = async ({ params }) => generateMeta({ config, params }) +type Args = { + params: { + collection: string + global: string + segments: string[] + } + searchParams: { [key: string]: string | string[] } +} -export default ({ params, searchParams }) => +export const generateMetadata = async ({ params }: Args) => generateMeta({ config, params }) + +const Page: React.FC = ({ params, searchParams }) => Document({ params, searchParams, config, }) + +export default Page diff --git a/src/app/(payload)/admin/(dashboard)/collections/[collection]/page.tsx b/src/app/(payload)/admin/(dashboard)/collections/[collection]/page.tsx index 0fa74fe..60ee4d0 100644 --- a/src/app/(payload)/admin/(dashboard)/collections/[collection]/page.tsx +++ b/src/app/(payload)/admin/(dashboard)/collections/[collection]/page.tsx @@ -1,14 +1,24 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import { ListView, generateMetadata as generateMeta } from '@payloadcms/next/pages/List' +import { ListView, generateMetadata as generateMeta } from '@payloadcms/next/pages/List/index' import config from '@payload-config' -export const generateMetadata = async ({ params }) => generateMeta({ config, params }) +type Args = { + params: { + collection: string + [key: string]: string | string[] + } + searchParams: { [key: string]: string | string[] } +} -export default ({ params, searchParams }) => +export const generateMetadata = async ({ params }: Args) => generateMeta({ config, params }) + +const Page: React.FC = ({ params, searchParams }) => ListView({ collectionSlug: params.collection, searchParams, config, - route: `/collections/${params.collection + (params.segments?.length ? `/${params.segments.join('/')}` : '')}`, + route: `/collections/${params.collection + (Array.isArray(params.segments) && params.segments?.length ? `/${params.segments.join('/')}` : '')}`, }) + +export default Page diff --git a/src/app/(payload)/layout.tsx b/src/app/(payload)/layout.tsx index e957ffa..1cc0981 100644 --- a/src/app/(payload)/layout.tsx +++ b/src/app/(payload)/layout.tsx @@ -1,9 +1,11 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import React from 'react' -import { RootLayout } from '@payloadcms/next/layouts/Root' +import { RootLayout } from '@payloadcms/next/layouts/Root/index' import configPromise from '@payload-config' -export default async ({ children }: { children: React.ReactNode }) => ( +const Layout = async ({ children }: { children: React.ReactNode }) => ( {children} ) + +export default Layout diff --git a/src/app/(payload)/page.tsx b/src/app/(payload)/page.tsx index bf29bc2..21306b5 100644 --- a/src/app/(payload)/page.tsx +++ b/src/app/(payload)/page.tsx @@ -1,6 +1,8 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import { RootPage } from '@payloadcms/next/pages/Root' +import { RootPage } from '@payloadcms/next/pages/Root/index' import config from '@payload-config' -export default () => RootPage({ config }) +const Page = () => RootPage({ config }) + +export default Page