since3-portal/app/(templates)/demo/[token]/page.tsx
2026-10-05 08:23:02 +02:00

23 lines
953 B
TypeScript

import type { Metadata } from "next"
import { notFound } from "next/navigation"
import { brandName } from "@/modules/templates/lib/content"
import { getSharedVariant } from "@/modules/templates/queries/shared-variant"
import { TemplateRenderer } from "@/modules/templates/ui/components/template-renderer"
export async function generateMetadata({ params }: PageProps<"/demo/[token]">): Promise<Metadata> {
const { token } = await params
const shared = await getSharedVariant(token)
return {
title: shared ? (brandName(shared.content) ?? shared.name) : "Entwurf",
robots: { index: false, follow: false },
}
}
export default async function SharedTemplatePage({ params }: PageProps<"/demo/[token]">) {
const { token } = await params
const shared = await getSharedVariant(token)
if (!shared) notFound()
return <TemplateRenderer templateKey={shared.def.key} content={shared.content} access={{ token }} />
}