MCPcopy Create free account
hub / github.com/tinyplex/tinybase / SiteSection

Function SiteSection

site/ui/SiteNodeSection.tsx:44–78  ·  view source on GitHub ↗
({children, dataId, id, thumbnail, title})

Source from the content-addressed store, hash-verified

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
80export const SiteNodeSection: FunctionComponent<Props> = ({
81 node,

Callers

nothing calls this directly

Calls 1

getThumbnailTitleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…