mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Implement /platform/list
This commit is contained in:
parent
7dcd39f106
commit
8fd7f7dece
4 changed files with 58 additions and 2 deletions
21
src/components/letterList/PlatformList.astro
Normal file
21
src/components/letterList/PlatformList.astro
Normal 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>
|
||||
))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue