From cbe282b5fd551eebc8c4e9e78bebe0c7a8014034 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 1 Mar 2024 12:01:20 -0500 Subject: [PATCH] chore: types more app exports --- .../globals/[global]/[[...segments]]/page.tsx | 19 ++++++++++++++++--- .../(dashboard)/globals/[global]/layout.tsx | 13 +++++++++++-- src/app/(payload)/admin/(dashboard)/page.tsx | 10 +++++++++- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/app/(payload)/admin/(dashboard)/globals/[global]/[[...segments]]/page.tsx b/src/app/(payload)/admin/(dashboard)/globals/[global]/[[...segments]]/page.tsx index 29ad7d5..aee43d7 100644 --- a/src/app/(payload)/admin/(dashboard)/globals/[global]/[[...segments]]/page.tsx +++ b/src/app/(payload)/admin/(dashboard)/globals/[global]/[[...segments]]/page.tsx @@ -1,13 +1,26 @@ /* 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: { + global?: string + collection?: 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({ config, params, searchParams, }) + +export default Page diff --git a/src/app/(payload)/admin/(dashboard)/globals/[global]/layout.tsx b/src/app/(payload)/admin/(dashboard)/globals/[global]/layout.tsx index e8d9a94..bf6ba55 100644 --- a/src/app/(payload)/admin/(dashboard)/globals/[global]/layout.tsx +++ b/src/app/(payload)/admin/(dashboard)/globals/[global]/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: { + global: string + } +} + +const Layout: React.FC = async ({ children, params }) => ( {children} ) + +export default Layout diff --git a/src/app/(payload)/admin/(dashboard)/page.tsx b/src/app/(payload)/admin/(dashboard)/page.tsx index a557f8c..9f7e18b 100644 --- a/src/app/(payload)/admin/(dashboard)/page.tsx +++ b/src/app/(payload)/admin/(dashboard)/page.tsx @@ -4,6 +4,14 @@ import { Dashboard, generateMetadata as generateMeta } from '@payloadcms/next/pa import { Metadata } from 'next' import config from '@payload-config' +type Args = { + searchParams: { + [key: string]: string | string[] + } +} + export const generateMetadata = async (): Promise => generateMeta({ config }) -export default async ({ searchParams }) => Dashboard({ config, searchParams }) +const Page: React.FC = async ({ searchParams }) => Dashboard({ config, searchParams }) + +export default Page