Create the upcoming events component

This commit is contained in:
itsfinniii
2026-03-20 21:51:54 +01:00
parent dcaf313745
commit fac720c4a1
7 changed files with 74 additions and 3 deletions

View File

@@ -0,0 +1,41 @@
---
import CalendarIcon from '@/icons/CalendarIcon.astro';
import { Image } from 'astro:assets';
interface Props {
upcomingEvents: UpcomingEventsComponent;
}
const upcomingEvents = Astro.props.upcomingEvents;
---
<div id={`upcomingevents-${upcomingEvents.id}`} class="flex flex-col justify-between items-center py-12 px-12 lg:container mx-auto gap-y-8 gap-x-18">
<h1 class="text-5xl font-bold">Upcoming Events</h1>
<div class="flex flex-col items-start gap-7 w-full">
{ upcomingEvents.events.map((event) => (
<div id={event.id} class="flex flex-row items-center justify-center gap-y-8 gap-x-18">
<div class="lg:w-[40%] w-full">
<Image
src={event.thumbnail.url}
width={event.thumbnail.width}
height={event.thumbnail.height}
class={`aspect-15/9 rounded-2xl shadow-sm object-cover`}
alt=""
/>
</div>
<div class="flex flex-col gap-1.5 lg:w-[40%] w-full">
<h3 class="text-3xl font-semibold">{event.title}</h3>
<div class="flex flex-row items-center gap-1.5 text-neutral-900">
<CalendarIcon width={24} height={24} />
{ event.endDate !== null ? (
<p>{event.startDate} - {event.endDate}</p>
) : (
<p>{event.startDate}</p>
) }
</div>
</div>
</div>
)) }
</div>
</div>