--- import SectionHeading from './SectionHeading.astro'; import type { EventItem } from '../lib/fallback-data'; import { formatDate, formatTime, formatWeekday } from '../lib/format'; import { normalizeSlug } from '../lib/slug'; 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; ---
{events.length > 0 ? ( events.map((event) => { const normalizedSlug = normalizeSlug(event.slug); const detailHref = normalizedSlug ? `/events/${normalizedSlug}/` : undefined; const summary = event.summary?.trim() || event.description; const time = formatTime(event.start_datetime); const logoSrc = typeof event.logo === 'string' ? event.logo : event.logo?.id; return ( ); }) ) : (

No events published

Directus events will render here when content is available.

)}