Files
buzz-sheet/app/[character]/page.tsx
T
gunshiz 08e5772acb
CI / Verify (push) Successful in 2m40s
CI / Build immutable images and deploy (push) Successful in 2m22s
chore(site) : remove apex domain routing and Google AdSense
2026-10-16 03:47:34 +07:00

36 lines
984 B
TypeScript

import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { StructuredGuideShell } from "@/components/public/structured-guide";
import { getCachedPublicGuide, getCachedPublicGuideSummary } from "@/lib/cache/public";
type Params = Promise<{ character: string }>;
export const instant = false;
export async function generateMetadata({
params,
}: {
params: Params;
}): Promise<Metadata> {
const guide = await getCachedPublicGuideSummary((await params).character);
return guide
? {
title: `${guide.name}`,
description: guide.overview,
openGraph: { images: [guide.coverUrl] },
twitter: { images: [guide.coverUrl] },
}
: { title: "ไม่พบไกด์" };
}
export default async function GuideOverviewPage({
params,
}: {
params: Params;
}) {
const guide = await getCachedPublicGuide((await params).character);
if (!guide) notFound();
return <StructuredGuideShell guide={guide} />;
}