"use client"; import Link from "next/link"; import { useSearchParams } from "next/navigation"; import { CATEGORIES } from "@/data/gunbuilderParts"; import type { Category } from "@/types/gunbuilder"; type BuilderNavProps = { activeCategoryId?: string | null; }; // Helper to group categories for the dropdowns function groupCategories(group: "lower" | "upper" | "accessories"): Category[] { return CATEGORIES.filter((c) => c.group === group); } export function BuilderNav({ activeCategoryId }: BuilderNavProps) { const searchParams = useSearchParams(); const lower = groupCategories("lower"); const upper = groupCategories("upper"); const accessories = groupCategories("accessories"); const currentCategory = activeCategoryId ?? searchParams.get("category") ?? undefined; const baseHref = "/builder"; const renderDropdown = (label: string, items: Category[]) => { if (!items.length) return null; return (
); }; return (
{/* ← aligns with topnav */}
); } export default BuilderNav;