MCPcopy
hub / github.com/shuding/nextra / Navbar

Function Navbar

examples/custom-theme/app/_components/navbar.tsx:9–39  ·  view source on GitHub ↗
({ pageMap })

Source from the content-addressed store, hash-verified

7import type { FC } from 'react'
8
9export const Navbar: FC<{ pageMap: PageMapItem[] }> = ({ pageMap }) => {
10 const pathname = usePathname()
11 const { topLevelNavbarItems } = normalizePages({
12 list: pageMap,
13 route: pathname
14 })
15
16 return (
17 <ul
18 style={{
19 display: 'flex',
20 listStyleType: 'none',
21 padding: 20,
22 gap: 20,
23 background: 'lightcoral',
24 margin: 0
25 }}
26 >
27 {topLevelNavbarItems.map(item => {
28 const route = item.route || ('href' in item ? item.href! : '')
29 return (
30 <li key={route}>
31 <Anchor href={route} style={{ textDecoration: 'none' }}>
32 {item.title}
33 </Anchor>
34 </li>
35 )
36 })}
37 </ul>
38 )
39}

Callers

nothing calls this directly

Calls 1

normalizePagesFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…