mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 19:51:17 +00:00
23 lines
953 B
TypeScript
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 }} />
|
|
}
|