Release / build-and-push (push) Has been cancelled
The bottom nav was hardcoded; the sidebar already read from the module registry. Converted BottomNav to a server component that calls getRegistry() using the same pattern as Sidebar, so any module with a nav field automatically populates both nav surfaces. Bumps version to 0.4.2.
22 lines
709 B
TypeScript
22 lines
709 B
TypeScript
import { getRegistry } from "@/modules/_core/registry";
|
|
import { NavLink } from "@/components/nav-link";
|
|
|
|
export async function BottomNav() {
|
|
const { modules } = getRegistry();
|
|
const moduleNav = modules.flatMap((m) => (m.nav ? [m.nav] : []));
|
|
|
|
const items = [
|
|
{ href: "/", label: "Dashboard", icon: "home" },
|
|
...moduleNav.map((n) => ({ href: n.href, label: n.label, icon: n.icon ?? "circle" })),
|
|
{ href: "/settings", label: "Settings", icon: "settings" },
|
|
];
|
|
|
|
return (
|
|
<nav className="bottom-nav" aria-label="Primary navigation">
|
|
{items.map((it) => (
|
|
<NavLink key={it.href} href={it.href} icon={it.icon} label={it.label} variant="bottom" />
|
|
))}
|
|
</nav>
|
|
);
|
|
}
|