({children, dataId, id, thumbnail, title})
| 42 | }; |
| 43 | readonly title: ReactNode; |
| 44 | }> = ({children, dataId, id, thumbnail, title}) => { |
| 45 | const {level} = useContext(SectionLevel); |
| 46 | const heading = React.createElement(`h${Math.min(level, 6)}`, {}, title); |
| 47 | |
| 48 | return ( |
| 49 | <SectionLevel.Provider value={useMemo(() => ({level: level + 1}), [level])}> |
| 50 | <section |
| 51 | className={`s${level}${thumbnail == null ? '' : ' withThumbnail'}`} |
| 52 | {...(id == null ? {} : {id})} |
| 53 | {...(dataId == null ? {} : {'data-id': dataId})} |
| 54 | > |
| 55 | {thumbnail == null ? ( |
| 56 | <> |
| 57 | {heading} |
| 58 | {children} |
| 59 | </> |
| 60 | ) : ( |
| 61 | <div className="thumbnailPanel"> |
| 62 | <a href={id}> |
| 63 | <img |
| 64 | src={thumbnail.src} |
| 65 | alt={thumbnail.alt} |
| 66 | title={getThumbnailTitle(thumbnail)} |
| 67 | /> |
| 68 | </a> |
| 69 | <div> |
| 70 | {heading} |
| 71 | {children} |
| 72 | </div> |
| 73 | </div> |
| 74 | )} |
| 75 | </section> |
| 76 | </SectionLevel.Provider> |
| 77 | ); |
| 78 | }; |
| 79 | |
| 80 | export const SiteNodeSection: FunctionComponent<Props> = ({ |
| 81 | node, |
nothing calls this directly
no test coverage detected
searching dependent graphs…