Implement sidebar Comment Carousel

This commit is contained in:
Jorge Vargas 2025-02-16 14:15:31 -06:00
parent 56c56c9877
commit fd696a59b4
4 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,27 @@
---
import prismaClient from 'utils/prisma-client'
import { Icon } from 'astro-icon/components'
import SidebarSection from './SidebarSection.astro'
import Looper from './CommentCarousel/Looper'
const comments = await prismaClient.comments.findMany({
select: { text: true, albums: { select: { id: true, title: true } } },
orderBy: { createdAt: 'desc' },
take: 5
})
---
<SidebarSection>
<Looper comments={comments} client:only='react'>
<Icon name='arrow-right' slot='arrowRight' class='group-hover:fill-black' height={30} width={15} fill='white' />
<Icon
name='arrow-right'
slot='arrowLeft'
class='group-hover:fill-black scale-x-[-1]'
height={30}
width={15}
fill='white'
/>
</Looper>
</SidebarSection>