@@ -0,0 +1,44 @@
|
||||
---
|
||||
import SectionHeading from './SectionHeading.astro';
|
||||
import type { EventItem } from '../lib/fallback-data';
|
||||
import { formatDateTime } from '../lib/format';
|
||||
|
||||
type Props = {
|
||||
events: EventItem[];
|
||||
title?: string;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
const { events, title = 'Upcoming events', description = 'A quick scan list for pilots, visitors, and local supporters.' } = Astro.props as Props;
|
||||
---
|
||||
|
||||
<section>
|
||||
<SectionHeading eyebrow="Events" title={title} description={description} />
|
||||
<div class="stack">
|
||||
{events.length > 0 ? (
|
||||
events.map((event) => (
|
||||
<article class="card">
|
||||
<div class="split-grid" style="align-items:start;">
|
||||
<div>
|
||||
<p class="pill">{event.is_featured ? 'Featured' : 'Event'}</p>
|
||||
<h3>{event.title}</h3>
|
||||
<p>{event.description}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="meta">{formatDateTime(event.start_datetime)}</p>
|
||||
{event.location_text && <p>{event.location_text}</p>}
|
||||
{event.registration_link && (
|
||||
<p><a class="button secondary" href={event.registration_link}>Register</a></p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
))
|
||||
) : (
|
||||
<article class="card">
|
||||
<h3>No events published</h3>
|
||||
<p>Directus events will render here when content is available.</p>
|
||||
</article>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user