feat: build game detail page with header, info panel, and screenshot gallery

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
consultoria-as
2026-02-22 04:03:41 +00:00
parent 70a603274b
commit e7e58bba29
4 changed files with 191 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { notFound } from "next/navigation";
import { getGameBySlug } from "@/lib/api";
import { GameHeader } from "@/components/game/GameHeader";
import { GameInfo } from "@/components/game/GameInfo";
import { ScreenshotGallery } from "@/components/game/ScreenshotGallery";
export default async function GamePage({
params,
}: {
params: Promise<{ locale: string; slug: string }>;
}) {
const { locale, slug } = await params;
let game;
try {
const res = await getGameBySlug(slug, locale);
game = Array.isArray(res.data) ? res.data[0] : res.data;
} catch {
notFound();
}
if (!game) notFound();
return (
<>
<GameHeader game={game} />
<div className="max-w-7xl mx-auto px-4 py-12">
<GameInfo game={game} locale={locale} />
{game.screenshots && (
<ScreenshotGallery screenshots={game.screenshots} />
)}
</div>
</>
);
}