import { Fragment } from 'react' import cx from 'classnames' import { slug } from 'github-slugger' import { ReleaseNotePatch } from './types' import { HeadingLink } from 'components/article/HeadingLink' import styles from './PatchNotes.module.scss' const SectionToLabelMap: Record = { features: 'Features', bugs: 'Bug fixes', known_issues: 'Known issues', security_fixes: 'Security fixes', changes: 'Changes', deprecations: 'Deprecations', backups: 'Backups', errata: 'Errata', } type Props = { patch: ReleaseNotePatch withReleaseNoteLabel?: boolean } export function PatchNotes({ patch, withReleaseNoteLabel }: Props) { return ( <> {Object.entries(patch.sections).map(([key, sectionItems], i, arr) => { const isLast = i === arr.length - 1 const sectionSlug = `${patch.version}-${key.replaceAll('_', '-')}` return (
{`${patch.version}: ${SectionToLabelMap[key]}` || 'INVALID SECTION'}
    {sectionItems.map((item, i) => { if (typeof item === 'string') { return (
  • ) } const headingSlug = item.heading ? slug(item.heading) : `heading${i}` return (
  • {item.heading}

  • {item.notes.map((note) => { return (
  • ) })} ) })}
) })} ) }