Implement /platform/list

This commit is contained in:
Jorge Vargas 2025-04-27 11:42:27 -06:00
parent 7dcd39f106
commit 8fd7f7dece
4 changed files with 58 additions and 2 deletions

View file

@ -0,0 +1,21 @@
---
import prismaClient from 'utils/prisma-client'
interface Props {
letter: string
}
const { letter } = Astro.props
const games = await prismaClient.platform.findMany({
where: { name: { startsWith: letter } },
select: { id: true, name: true }
})
---
{
games.map((a) => (
<a class='text-left hover:bg-btn-gray/30 rounded-md p-2' href={`/game/${a.id}`}>
{a.name}
</a>
))
}