MCPcopy Index your code
hub / github.com/tinyplex/tinybase / SiteNodeSectionBlock

Function SiteNodeSectionBlock

site/ui/SiteNodeSection.tsx:153–193  ·  view source on GitHub ↗
({children, node, summary = false})

Source from the content-addressed store, hash-verified

151 readonly node: Node;
152 readonly summary?: boolean;
153}> = ({children, node, summary = false}) => {
154 const isSingle = useIsSingle();
155 const {body, summary: cleanedSummary, thumbnail} = getThumbnailMarkdown(node);
156 const summaryMarkdown = getSummaryMarkdown(node);
157 const parts = [];
158
159 if (summary ? summaryMarkdown : cleanedSummary) {
160 parts.push(
161 <Markdown
162 html={true}
163 markdown={
164 (summary ? summaryMarkdown : cleanedSummary) +
165 getReadMore(summary, isSingle, node)
166 }
167 key="summary"
168 />,
169 );
170 }
171 if (!summary && body) {
172 parts.push(<Markdown html={true} markdown={body} key="body" />);
173 }
174 parts.push(children);
175 if (node.essential) {
176 parts.unshift(
177 <div className="essential" key="essential">
178 Essential
179 </div>,
180 );
181 }
182
183 return (
184 <SiteSection
185 title={<NodeName node={node} />}
186 id={node.url}
187 dataId={node.id}
188 thumbnail={summary ? thumbnail : undefined}
189 >
190 {parts}
191 </SiteSection>
192 );
193};
194
195const SiteNodeSectionItem: FunctionComponent<{readonly node: Node}> = ({
196 node,

Callers

nothing calls this directly

Calls 3

getThumbnailMarkdownFunction · 0.90
getSummaryMarkdownFunction · 0.90
getReadMoreFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…