feat: build game catalog page with filters and grid
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
32
apps/web/src/app/[locale]/catalog/page.tsx
Normal file
32
apps/web/src/app/[locale]/catalog/page.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Suspense } from "react";
|
||||
import { getGames } from "@/lib/api";
|
||||
import { CatalogFilters } from "@/components/catalog/CatalogFilters";
|
||||
import { CatalogGrid } from "@/components/catalog/CatalogGrid";
|
||||
|
||||
export default async function CatalogPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>;
|
||||
}) {
|
||||
const { locale } = await params;
|
||||
|
||||
let games: any[] = [];
|
||||
try {
|
||||
const res = await getGames(locale);
|
||||
games = res.data;
|
||||
} catch {
|
||||
// Strapi not running
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="max-w-7xl mx-auto px-4 py-12">
|
||||
<h1 className="text-4xl font-bold mb-8">
|
||||
{locale === "es" ? "Catálogo de Juegos" : "Game Catalog"}
|
||||
</h1>
|
||||
<Suspense>
|
||||
<CatalogFilters />
|
||||
</Suspense>
|
||||
<CatalogGrid games={games} locale={locale} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user