diff --git a/astro.config.mjs b/astro.config.mjs
index 2d35aa0..14e541b 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -49,9 +49,7 @@ export default defineConfig({
adapter: node({ mode: 'standalone' }),
redirects: {
'/anim/[id]': { status: 307, destination: '/maintenance' },
- '/anim/list': { status: 307, destination: '/maintenance' },
'/game/[slug]': { status: 307, destination: '/maintenance' },
- '/game/list': { status: 307, destination: '/maintenance' },
'/platform/list': { status: 307, destination: '/maintenance' },
'/platform/[id]': { status: 307, destination: '/maintenance' },
'/profile': { status: 307, destination: '/maintenance' },
diff --git a/src/components/albumList/letterSection.astro b/src/components/listPage/AlbumLetterSection.astro
similarity index 91%
rename from src/components/albumList/letterSection.astro
rename to src/components/listPage/AlbumLetterSection.astro
index 23c6b49..91e5420 100644
--- a/src/components/albumList/letterSection.astro
+++ b/src/components/listPage/AlbumLetterSection.astro
@@ -13,7 +13,7 @@ const albums = await prismaClient.albums.findMany({
})
---
-
+
diff --git a/src/components/listPage/GameLetterSection.astro b/src/components/listPage/GameLetterSection.astro
new file mode 100644
index 0000000..dc81547
--- /dev/null
+++ b/src/components/listPage/GameLetterSection.astro
@@ -0,0 +1,23 @@
+---
+import prismaClient from 'utils/prisma-client'
+
+interface Props {
+ letter: string
+}
+
+const { letter } = Astro.props
+const games = await prismaClient.game.findMany({
+ where: { name: { startsWith: letter } },
+ select: { slug: true, name: true }
+})
+---
+
+
+ {
+ games.map((g) => (
+
+ {g.name}
+
+ ))
+ }
+
diff --git a/src/layouts/ListLayout.astro b/src/layouts/ListLayout.astro
new file mode 100644
index 0000000..2d1982e
--- /dev/null
+++ b/src/layouts/ListLayout.astro
@@ -0,0 +1,35 @@
+---
+interface Props {
+ letters: { letter: string; count: BigInt }[]
+}
+
+import Sidebar from 'components/Sidebar.astro'
+import Base from './base.astro'
+
+const { letters } = Astro.props
+---
+
+
+
+
+
+ {
+ letters.map((l) => (
+
+ ))
+ }
+
+
+
+
+
+
+
+
diff --git a/src/pages/album/list/index.astro b/src/pages/album/list/index.astro
index 53274cc..f0d366a 100644
--- a/src/pages/album/list/index.astro
+++ b/src/pages/album/list/index.astro
@@ -1,9 +1,8 @@
---
import prismaClient from 'utils/prisma-client'
-import BaseLayout from 'layouts/base.astro'
-import Sidebar from 'components/Sidebar.astro'
-import LetterSection from 'components/albumList/letterSection.astro'
+import ListLayout from 'layouts/ListLayout.astro'
+import AlbumLetterSection from 'components/listPage/AlbumLetterSection.astro'
const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRaw`
SELECT DISTINCT UPPER(LEFT(title, 1)) AS letter, COUNT(*) AS count
@@ -14,44 +13,21 @@ const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRa
`
---
-
-
-
-
- {
- letters.map((l) => (
-
- ))
- }
+
+ {
+ letters.map((l) => (
+
+
{l.letter}
+
+
+
+ {Array.from({ length: Number(l.count) }).map(() => (
+
+ ))}
+
+
+
-
- {
- letters.map((l) => (
-
-
{l.letter}
-
-
-
-
- {Array.from({ length: Number(l.count) }).map(() => (
-
- ))}
-
-
-
-
-
- ))
- }
-
-
-
-
-
+ ))
+ }
+
diff --git a/src/pages/anim/list/index.astro b/src/pages/anim/list/index.astro
new file mode 100644
index 0000000..789ce20
--- /dev/null
+++ b/src/pages/anim/list/index.astro
@@ -0,0 +1,32 @@
+---
+import prismaClient from 'utils/prisma-client'
+
+import ListLayout from 'layouts/ListLayout.astro'
+import GameLetterSection from 'components/listPage/GameLetterSection.astro'
+
+const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRaw`
+ SELECT DISTINCT UPPER(LEFT(name, 1)) AS letter, COUNT(*) AS count
+ FROM game
+ GROUP BY letter
+ ORDER BY letter;
+ `
+---
+
+
+ {
+ letters.map((l) => (
+
+
{l.letter}
+
+
+
+ {Array.from({ length: Number(l.count) }).map(() => (
+
+ ))}
+
+
+
+
+ ))
+ }
+
diff --git a/src/pages/game/list/index.astro b/src/pages/game/list/index.astro
new file mode 100644
index 0000000..789ce20
--- /dev/null
+++ b/src/pages/game/list/index.astro
@@ -0,0 +1,32 @@
+---
+import prismaClient from 'utils/prisma-client'
+
+import ListLayout from 'layouts/ListLayout.astro'
+import GameLetterSection from 'components/listPage/GameLetterSection.astro'
+
+const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRaw`
+ SELECT DISTINCT UPPER(LEFT(name, 1)) AS letter, COUNT(*) AS count
+ FROM game
+ GROUP BY letter
+ ORDER BY letter;
+ `
+---
+
+
+ {
+ letters.map((l) => (
+
+
{l.letter}
+
+
+
+ {Array.from({ length: Number(l.count) }).map(() => (
+
+ ))}
+
+
+
+
+ ))
+ }
+