({ tree, section, page }: SidebarProps)
| 23 | * gets the section switcher above and the site links below. |
| 24 | */ |
| 25 | export const Sidebar = ({ tree, section, page }: SidebarProps) => ( |
| 26 | <> |
| 27 | <SectionSwitcher |
| 28 | sections={docsSectionsOf(tree)} |
| 29 | current={section.id} |
| 30 | url={page.url} |
| 31 | /> |
| 32 | <nav className="side-nav" aria-label={section.title}> |
| 33 | {groupsOf(section.items).map((group, i) => ( |
| 34 | <div className="sn-group" key={group.title ?? i}> |
| 35 | {group.title && ( |
| 36 | <p className="sn-label"> |
| 37 | <span aria-hidden>// </span> |
| 38 | {group.title.toLowerCase()} |
| 39 | </p> |
| 40 | )} |
| 41 | <ul> |
| 42 | {group.items.map((item, i) => ( |
| 43 | <SidebarItem key={i} item={item} page={page} /> |
| 44 | ))} |
| 45 | </ul> |
| 46 | </div> |
| 47 | ))} |
| 48 | </nav> |
| 49 | <div className="side-foot"> |
| 50 | <Link href="/playground" prefetch={false}> |
| 51 | Playground |
| 52 | </Link> |
| 53 | <Link href="/docs/blog" prefetch={false}> |
| 54 | Blog |
| 55 | </Link> |
| 56 | {externalLinks.map(link => ( |
| 57 | <a |
| 58 | key={link.title} |
| 59 | className="ext" |
| 60 | href={link.href} |
| 61 | target="_blank" |
| 62 | rel="noreferrer" |
| 63 | > |
| 64 | {link.title} |
| 65 | </a> |
| 66 | ))} |
| 67 | </div> |
| 68 | <SidebarEffects /> |
| 69 | </> |
| 70 | ) |
| 71 | |
| 72 | const SectionSwitcher = ({ |
| 73 | sections, |
nothing calls this directly
no test coverage detected