Files
gunshiz 87e6bcd96f
CI / Verify and audit (push) Successful in 2m33s
CI / Build, scan and deploy immutable images (push) Failing after 1m29s
feat : 6 astra improve it
2026-09-22 18:28:18 +07:00

36 lines
1.2 KiB
TypeScript

import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { GoogleAdsense } from "@/components/public/google-adsense";
import { publicSections, StructuredGuideShell } from "@/components/public/structured-guide";
import { getCachedPublicGuide, getCachedPublicGuideSummary } 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 getCachedPublicGuideSummary(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, page);
if (!guide || !publicSections(guide).some((section) => section.slug === page)) notFound();
return (
<>
<GoogleAdsense />
<StructuredGuideShell guide={guide} section={page} />
</>
);
}