/* eslint-disable no-useless-escape */ import { Article, ArticleHeading, ArticleHeadings } from '@/types/content-types' import Link from 'next/link' export function ArticleHeadingLinks({ headingLinks, }: { article: Article headingLinks: ArticleHeadings }) { const linksToShow = headingLinks.filter((heading) => heading.level < 4) if (linksToShow.length <= 1) return null return ( ) } function HeaderLink({ heading }: { heading: ArticleHeading }) { return (
  • {heading.level > 2 ? {'–'} : null} {heading.isCode ? ( {heading.title.replace(/\[([^\]]+)\]\([^\)]+\)/g, '$1')} ) : ( heading.title.replace(/\[([^\]]+)\]\([^\)]+\)/g, '$1') )}
  • ) }