--- import { feedType, feedTypes, getFeed } from '../data/insights'; import { Picture } from 'astro:assets'; import Base from '../layouts/Base.astro'; import { formatDate, localePath, t, type Lang } from '../i18n/ui'; interface Props { lang: Lang } const { lang } = Astro.props; const ui = t(lang); const feed = await getFeed(); const m = ui.insights.mention; const f = ui.insights.filter; /* Only filters that have entries; "All" first. */ const filters = [ { key: 'all', label: f.all, count: feed.length }, ...feedTypes .map((key) => ({ key, label: f[key], count: feed.filter((item) => feedType(item) === key).length })) .filter((x) => x.count > 0), ]; ---

{ui.insights.title}

{ui.insights.intro}

{filters.length > 2 && (
{f.label}
{filters.map((x) => ( ))}
)}