MCPcopy Create free account
hub / github.com/fontsource/fontsource / LeftSidebar

Function LeftSidebar

website/app/components/docs/LeftSidebar.tsx:208–239  ·  view source on GitHub ↗
({ tree, toggle }: LeftSidebarProps)

Source from the content-addressed store, hash-verified

206};
207
208const LeftSidebar = ({ tree, toggle }: LeftSidebarProps) => {
209 const pageTree = usePageTree(tree);
210 const location = useLocation();
211
212 if (!pageTree) return null;
213
214 const activeFolder = activeRootFolder(pageTree, location.pathname);
215
216 return (
217 <nav className={classes.wrapper} aria-label="Documentation">
218 <Stack className={classes.rootSections} gap={1}>
219 {pageTree.children.map((node) => (
220 <RootSection
221 key={nodeKey(node)}
222 node={node}
223 currentPath={location.pathname}
224 toggle={toggle}
225 />
226 ))}
227 </Stack>
228 {activeFolder && (
229 <Stack className={classes.activeSection} gap={3}>
230 <SidebarNodes
231 nodes={activeFolder.children}
232 currentPath={location.pathname}
233 toggle={toggle}
234 />
235 </Stack>
236 )}
237 </nav>
238 );
239};
240
241export { LeftSidebar };

Callers

nothing calls this directly

Calls 3

usePageTreeFunction · 0.85
activeRootFolderFunction · 0.85
nodeKeyFunction · 0.85

Tested by

no test coverage detected