Files
buzz-sheet/app/[character]/page.tsx
T
2026-09-01 20:54:54 +07:00

32 lines
905 B
TypeScript

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