Files
buzz-sheet/app/[character]/[page]/page.tsx
T
gunshiz e3692fe75b
CI / Verify (push) Successful in 59s
CI / Build immutable images and deploy (push) Failing after 1m4s
feat : better ui
2026-08-31 00:48:33 +07:00

24 lines
1.0 KiB
TypeScript

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