@@ -0,0 +1,33 @@
|
||||
---
|
||||
import SectionHeading from './SectionHeading.astro';
|
||||
import type { NewsItem } from '../lib/fallback-data';
|
||||
import { formatDate } from '../lib/format';
|
||||
|
||||
type Props = {
|
||||
news: NewsItem[];
|
||||
title?: string;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
const { news, title = 'Latest news', description = 'Fresh updates, operational changes, and airport announcements.' } = Astro.props as Props;
|
||||
---
|
||||
|
||||
<section>
|
||||
<SectionHeading eyebrow="News" title={title} description={description} />
|
||||
<div class="cards-grid">
|
||||
{news.length > 0 ? (
|
||||
news.map((item) => (
|
||||
<article class="card">
|
||||
<p class="meta">{formatDate(item.publish_date)}</p>
|
||||
<h3><a href={`/news/${item.slug}/`}>{item.title}</a></h3>
|
||||
<p>{item.summary}</p>
|
||||
</article>
|
||||
))
|
||||
) : (
|
||||
<article class="card">
|
||||
<h3>No news items</h3>
|
||||
<p>News articles will be generated from Directus at build time.</p>
|
||||
</article>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user