Files
buzz-sheet/app/[character]/[page]/page.tsx
T
gunshiz dc5c667b4e
CI / Verify (push) Successful in 1m0s
CI / Build immutable images and deploy (push) Failing after 2m38s
feat(guides): add structured image-first editor
2026-08-29 13:30:52 +00: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 { getPublicGuide } from "@/lib/guides/queries";
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 getPublicGuide(character);
return guide ? { title: `${page} — ${guide.name} Build Guide`, description: guide.overview } : { title: "ไม่พบ Guide" };
}
export default async function GuideSectionPage({ params }: { params: Params }) {
await connection();
const { character, page } = await params;
const guide = await getPublicGuide(character);
if (!guide || !publicSections(guide).some((section) => section.slug === page)) notFound();
return <StructuredGuideShell guide={guide} section={page} />;
}