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>
  );
}
