Files
buzz-sheet/app/[character]/[page]/page.tsx
T
gunshiz 1164715d64
CI / Verify (push) Successful in 1m7s
CI / Build immutable images and deploy (push) Successful in 2m13s
feat : use cover image guide instead of shit image generater
2026-09-11 17:28:38 +07:00

30 lines
1.1 KiB
TypeScript

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