rewrite nav

This commit is contained in:
outfoxxed 2024-10-24 16:26:48 -07:00
parent 6249a0aba7
commit 5341fe58d0
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
18 changed files with 254 additions and 415 deletions

View file

@ -0,0 +1,23 @@
---
import NavCollapsible from "@components/NavCollapsible.astro";
import Self from "./Tree.astro";
import Link from "./Link.astro";
interface TreeEntry {
title: string;
link: string;
current?: boolean;
entries?: TreeEntry[];
}
interface Props extends TreeEntry {}
const { title, link, entries, current } = Astro.props;
---
<NavCollapsible title={title} link={link} current={current ?? false}>
{entries?.map(entry => entry.entries ? (
<Self {...entry}/>
) : (
<Link title={entry.title} link={entry.link} current={entry.current}/>
))}
</NavCollapsible>