Initial layout and a few pages
This commit is contained in:
26
components/nav/index.tsx
Normal file
26
components/nav/index.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { NavItem } from "../../types/nav.ts";
|
||||
import { getNavItems } from "../../util/getNavItems.ts";
|
||||
|
||||
export function NavSection(props: { items: NavItem[] }) {
|
||||
return (
|
||||
<ul>
|
||||
{props.items.map((i) => (
|
||||
<li>
|
||||
{i.children
|
||||
? <NavSection items={i.children} />
|
||||
: <a href={i.href} target={i.external ? "_blank" : ""}>{i.title}
|
||||
</a>}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export function Nav() {
|
||||
const navItems = getNavItems();
|
||||
return (
|
||||
<NavSection
|
||||
items={navItems}
|
||||
/>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user