({ tree, toggle }: LeftSidebarProps)
| 206 | }; |
| 207 | |
| 208 | const 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 | |
| 241 | export { LeftSidebar }; |
nothing calls this directly
no test coverage detected