"use client" /** * SecondaryNav — two-panel contextual navigation * * Layout: * ┌──────┬──────────────────────────┐ * │ Rail │ Content panel │ * │ (52) │ (200–240px) │ * │ │ Section heading │ * │ ◉ │ · Nav item │ * │ ○ │ · Nav item (active) │ * │ ○ │ ───────────────── │ * │ │ Section heading │ * │ │ · Nav item │ * └──────┴──────────────────────────┘ * * Usage: * * * Or use composed pieces: * * */ import * as React from "react" import { usePathname } from "@/lib/router-compat" import { cn } from "@/lib/utils" import { resolveActiveNavHref } from "@exxatdesignux/ui/lib/nav-active" import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip" // ───────────────────────────────────────────────────────────────────────────── // Types // ───────────────────────────────────────────────────────────────────────────── export interface SecondaryNavLink { /** Unique key */ key: string label: string href: string icon?: string /** Badge count shown on link */ count?: number /** If true, item is rendered as a section divider label (not a link) */ isSectionHeader?: boolean } export interface SecondaryNavSectionAction { /** Tooltip / aria-label */ label: string /** FontAwesome icon class, e.g. "fa-plus" */ icon: string onClick: () => void } export interface SecondaryNavSection { /** Unique key — used to identify the active section */ key: string /** Tooltip shown on rail icon */ label: string /** FontAwesome icon class, e.g. "fa-users" */ icon: string /** Solid icon used when section is active */ iconActive?: string /** Flat list of links (use isSectionHeader=true for dividers) */ links: SecondaryNavLink[] /** When true, a search input is shown above the list and filters link labels */ searchable?: boolean /** Placeholder for the search input */ searchPlaceholder?: string /** Optional primary action rendered next to the section title (e.g. Add) */ action?: SecondaryNavSectionAction } // ───────────────────────────────────────────────────────────────────────────── // RailButton — single icon in the narrow left rail // ───────────────────────────────────────────────────────────────────────────── function RailButton({ section, isActive, onClick, }: { section: SecondaryNavSection isActive: boolean onClick: () => void }) { return (