--- interface Props { headings: { depth: number; slug: string; text: string }[]; } const { headings } = Astro.props; const toc = headings.filter((h) => h.depth >= 2 && h.depth <= 3); --- {toc.length > 0 && ( )}