--- interface Heading { depth: number; slug: string; text: string; } interface Props { headings: (Heading & { label?: boolean })[]; } const {headings} = Astro.props; const items = headings.filter(h => h.depth >= 2 && h.depth <= 4); const minDepth = items.length > 0 ? Math.min(...items.map(h => h.depth)) : 2; --- {items.length > 0 && ( )}