({ patch, withReleaseNoteLabel }: Props)
| 22 | withReleaseNoteLabel?: boolean |
| 23 | } |
| 24 | export function PatchNotes({ patch, withReleaseNoteLabel }: Props) { |
| 25 | return ( |
| 26 | <> |
| 27 | {Object.entries(patch.sections).map(([key, sectionItems], i, arr) => { |
| 28 | const isLast = i === arr.length - 1 |
| 29 | const sectionSlug = `${patch.version}-${key.replaceAll('_', '-')}` |
| 30 | return ( |
| 31 | <div |
| 32 | key={key} |
| 33 | className={cx( |
| 34 | 'py-6 d-block d-xl-flex', |
| 35 | !withReleaseNoteLabel && 'mx-6', |
| 36 | !isLast && 'border-bottom' |
| 37 | )} |
| 38 | > |
| 39 | <ul className={cx(withReleaseNoteLabel)}> |
| 40 | <h3 id={sectionSlug}> |
| 41 | <LinkIconHeading slug={sectionSlug} /> |
| 42 | {SectionToLabelMap[key] || 'INVALID SECTION'} |
| 43 | </h3> |
| 44 | {sectionItems.map((item) => { |
| 45 | if (typeof item === 'string') { |
| 46 | return <li key={item} className="f4" dangerouslySetInnerHTML={{ __html: item }} /> |
| 47 | } |
| 48 | |
| 49 | const headingSlug = item.heading ? slug(item.heading) : '' |
| 50 | return ( |
| 51 | <Fragment key={headingSlug}> |
| 52 | <h4 id={headingSlug} className={cx(styles.sectionHeading, 'text-bold f4')}> |
| 53 | <Link href={`#${headingSlug}`}>{item.heading}</Link> |
| 54 | </h4> |
| 55 | {item.notes.map((note) => { |
| 56 | return ( |
| 57 | <li key={note} className="f4" dangerouslySetInnerHTML={{ __html: note }} /> |
| 58 | ) |
| 59 | })} |
| 60 | </Fragment> |
| 61 | ) |
| 62 | })} |
| 63 | </ul> |
| 64 | </div> |
| 65 | ) |
| 66 | })} |
| 67 | </> |
| 68 | ) |
| 69 | } |
nothing calls this directly
no outgoing calls
no test coverage detected