diff --git a/apps/docs/src/app/(embed)/embed/page.tsx b/apps/docs/src/app/(embed)/embed/page.tsx index a5b653b6..67aca682 100644 --- a/apps/docs/src/app/(embed)/embed/page.tsx +++ b/apps/docs/src/app/(embed)/embed/page.tsx @@ -1,15 +1,17 @@ import { getErrorMessage } from '@tszhong0411/utils' type PageProps = { - params: Promise> - searchParams: Promise<{ - component: string - }> + params: Promise> + searchParams: Promise> } const Page = async (props: PageProps) => { const { component } = await props.searchParams + if (!component || typeof component !== 'string') { + return
Error: Invalid component name
+ } + try { const Component = (await import(`@/components/demos/${component}`)).default diff --git a/apps/web/src/app/[locale]/(admin)/layout.tsx b/apps/web/src/app/[locale]/(admin)/layout.tsx index 49d3b951..52c5202f 100644 --- a/apps/web/src/app/[locale]/(admin)/layout.tsx +++ b/apps/web/src/app/[locale]/(admin)/layout.tsx @@ -9,7 +9,7 @@ type LayoutProps = { params: Promise<{ locale: string }> - searchParams: Promise> + searchParams: Promise> children: React.ReactNode } diff --git a/apps/web/src/app/[locale]/(main)/about/page.tsx b/apps/web/src/app/[locale]/(main)/about/page.tsx index 6e556739..2f750c52 100644 --- a/apps/web/src/app/[locale]/(main)/about/page.tsx +++ b/apps/web/src/app/[locale]/(main)/about/page.tsx @@ -22,7 +22,7 @@ type PageProps = { params: Promise<{ locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ locale: string }> => { diff --git a/apps/web/src/app/[locale]/(main)/blog/[slug]/page.tsx b/apps/web/src/app/[locale]/(main)/blog/[slug]/page.tsx index 6854fd69..2f350910 100644 --- a/apps/web/src/app/[locale]/(main)/blog/[slug]/page.tsx +++ b/apps/web/src/app/[locale]/(main)/blog/[slug]/page.tsx @@ -25,7 +25,7 @@ type PageProps = { slug: string locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ slug: string; locale: string }> => { diff --git a/apps/web/src/app/[locale]/(main)/blog/page.tsx b/apps/web/src/app/[locale]/(main)/blog/page.tsx index b5eb3694..0c51b097 100644 --- a/apps/web/src/app/[locale]/(main)/blog/page.tsx +++ b/apps/web/src/app/[locale]/(main)/blog/page.tsx @@ -13,7 +13,7 @@ type PageProps = { params: Promise<{ locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ locale: string }> => { diff --git a/apps/web/src/app/[locale]/(main)/dashboard/page.tsx b/apps/web/src/app/[locale]/(main)/dashboard/page.tsx index a012dca8..5a8b0eb9 100644 --- a/apps/web/src/app/[locale]/(main)/dashboard/page.tsx +++ b/apps/web/src/app/[locale]/(main)/dashboard/page.tsx @@ -14,7 +14,7 @@ type PageProps = { params: Promise<{ locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ locale: string }> => { diff --git a/apps/web/src/app/[locale]/(main)/guestbook/page.tsx b/apps/web/src/app/[locale]/(main)/guestbook/page.tsx index da0d4770..8e308a66 100644 --- a/apps/web/src/app/[locale]/(main)/guestbook/page.tsx +++ b/apps/web/src/app/[locale]/(main)/guestbook/page.tsx @@ -18,7 +18,7 @@ type PageProps = { params: Promise<{ locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ locale: string }> => { diff --git a/apps/web/src/app/[locale]/(main)/page.tsx b/apps/web/src/app/[locale]/(main)/page.tsx index 9fb567e0..c51d3edf 100644 --- a/apps/web/src/app/[locale]/(main)/page.tsx +++ b/apps/web/src/app/[locale]/(main)/page.tsx @@ -24,7 +24,7 @@ type PageProps = { params: Promise<{ locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ locale: string }> => { diff --git a/apps/web/src/app/[locale]/(main)/projects/[slug]/page.tsx b/apps/web/src/app/[locale]/(main)/projects/[slug]/page.tsx index 1d4c7dff..4da17ff1 100644 --- a/apps/web/src/app/[locale]/(main)/projects/[slug]/page.tsx +++ b/apps/web/src/app/[locale]/(main)/projects/[slug]/page.tsx @@ -16,7 +16,7 @@ type PageProps = { slug: string locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ slug: string; locale: string }> => { diff --git a/apps/web/src/app/[locale]/(main)/projects/page.tsx b/apps/web/src/app/[locale]/(main)/projects/page.tsx index 58766b6c..dbac7c44 100644 --- a/apps/web/src/app/[locale]/(main)/projects/page.tsx +++ b/apps/web/src/app/[locale]/(main)/projects/page.tsx @@ -13,7 +13,7 @@ type PageProps = { params: Promise<{ locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ locale: string }> => { diff --git a/apps/web/src/app/[locale]/(main)/uses/page.tsx b/apps/web/src/app/[locale]/(main)/uses/page.tsx index d8647291..f5a10bbf 100644 --- a/apps/web/src/app/[locale]/(main)/uses/page.tsx +++ b/apps/web/src/app/[locale]/(main)/uses/page.tsx @@ -14,7 +14,7 @@ type PageProps = { params: Promise<{ locale: string }> - searchParams: Promise> + searchParams: Promise> } export const generateStaticParams = (): Array<{ locale: string }> => {