({ pageMap })
| 7 | import type { FC } from 'react' |
| 8 | |
| 9 | export 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…