import {EntityLocale} from '@prisma/client' import type {Metadata} from 'next' import {notFound} from 'next/navigation' import {Suspense} from 'react' import {getPageEntityBySlug} from '@/actions/admin/entity' import YoutubeComponent from '@/components/shared/youtube-component' import {dump, normalizeData, thisLocale} from '@/lib/utils' import {Skeleton} from '@/ui/skeleton' type Props = { params: Promise<{slug?: string}> } export const generateMetadata = async ({params}: Props): Promise => { const {slug} = await params const page = await getPageEntityBySlug(slug || '') if (!page) { notFound() } const {locales} = page const locale: EntityLocale = await thisLocale(locales) const {title, annotation} = locale return { title, description: normalizeData(annotation, { stripTags: true }) } } export default async function Pages({params}: Props) { const {slug} = await params const page = await getPageEntityBySlug(slug || '') if (!page) { notFound() } const {locales} = page const locale: EntityLocale = await thisLocale(locales) const {title, annotation, body} = locale return (

{title}

}>
{/*{dump(locale)}*/}
) }