mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
last added
This commit is contained in:
parent
c4055fa695
commit
a508ada21c
4 changed files with 33 additions and 3 deletions
30
src/pages/last-added/index.astro
Normal file
30
src/pages/last-added/index.astro
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
import prismaClient from 'utils/prisma-client'
|
||||
import * as m from 'paraglide/messages'
|
||||
|
||||
import BaseLayout from 'layouts/base.astro'
|
||||
import AlbumBox from 'components/AlbumBox.astro'
|
||||
|
||||
const lastAlbums = await prismaClient.albums.findMany({
|
||||
select: { id: true, title: true },
|
||||
take: 40,
|
||||
orderBy: { createdAt: 'desc' }
|
||||
})
|
||||
---
|
||||
|
||||
<BaseLayout>
|
||||
<div class='w-full min-h-100vh mx-auto max-w-[1440px]'>
|
||||
<div class='px-2 mb-2'>
|
||||
<h1 class='uppercase font-medium tracking-wide text-5xl drop-shadow-2xl mt-5 mb-2 text-center'>
|
||||
{m.lastAdded()}
|
||||
</h1>
|
||||
<div class='grid grid-cols-4 gap-x-1.5'>
|
||||
{
|
||||
lastAlbums.map((album) => (
|
||||
<AlbumBox title={album.title} href={`/album/${album.id}`} image={`/album/${album.id}.png`} />
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</BaseLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue