feat: build interactive documentary page with audio player and chapter navigation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
24
apps/web/src/app/[locale]/games/[slug]/documentary/page.tsx
Normal file
24
apps/web/src/app/[locale]/games/[slug]/documentary/page.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { notFound } from "next/navigation";
|
||||
import { getDocumentaryByGameSlug } from "@/lib/api";
|
||||
import { DocumentaryLayout } from "@/components/documentary/DocumentaryLayout";
|
||||
|
||||
export default async function DocumentaryPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string; slug: string }>;
|
||||
}) {
|
||||
const { locale, slug } = await params;
|
||||
|
||||
let documentary;
|
||||
try {
|
||||
documentary = await getDocumentaryByGameSlug(slug, locale);
|
||||
} catch {
|
||||
notFound();
|
||||
}
|
||||
|
||||
if (!documentary || !documentary.chapters?.length) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return <DocumentaryLayout documentary={documentary} />;
|
||||
}
|
||||
Reference in New Issue
Block a user