diff --git a/src/components/GameFilters.astro b/src/components/GameFilters.astro
new file mode 100644
index 0000000..f5de26d
--- /dev/null
+++ b/src/components/GameFilters.astro
@@ -0,0 +1,124 @@
+---
+import type { Category, Publisher } from '../types/game';
+
+interface Props {
+ categories: Category[];
+ publishers: Publisher[];
+}
+
+const { categories, publishers } = Astro.props;
+---
+
+
+
+
Filter games
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/index.astro b/src/pages/index.astro
index 5ad3cfa..60da4e2 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -3,12 +3,18 @@ import Layout from '../layouts/Layout.astro';
import GameCard from '../components/GameCard.astro';
import PageHero from '../components/PageHero.astro';
import EmptyState from '../components/EmptyState.astro';
+import GameFilters from '../components/GameFilters.astro';
import { getDatabase } from '../lib/db';
import { getAllGames } from '../lib/games';
+import { getAllCategories } from '../lib/categories';
+import { getAllPublishers } from '../lib/publishers';
export const prerender = true;
-const games = await getAllGames(getDatabase());
+const db = getDatabase();
+const games = await getAllGames(db);
+const categories = await getAllCategories(db);
+const publishers = await getAllPublishers(db);
---
@@ -24,10 +30,19 @@ const games = await getAllGames(getDatabase());
{games.length === 0 ? (
) : (
-
- {games.map((game) => )}
-
+ <>
+ {(categories.length > 0 || publishers.length > 0) && (
+
+ )}
+
+ {games.map((game) => )}
+
+
+
+
+ >
)}
+
From 8574b0e611f712cdf8872ad3230fc9e61d1fd2c2 Mon Sep 17 00:00:00 2001
From: Kamar Shad