"use client"; import { useState } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; const navItems = [ { label: "Dashboard", href: "/" }, { label: "Receive", href: "/receive" }, { label: "Send", href: "/send" }, { label: "Transfer", href: "/transfer" }, { label: "Approvals", href: "/approvals" }, { label: "Activity", href: "/activity" }, { label: "Settings", href: "/settings" }, ]; function NavLink({ href, label, isActive, onNavigate, }: { href: string; label: string; isActive: boolean; onNavigate?: () => void; }) { return ( {label} ); } export function Navigation() { const pathname = usePathname(); const [mobileOpen, setMobileOpen] = useState(false); const closeMobile = () => setMobileOpen(false); return ( {/* Mobile: menu toggle + horizontal scroll fallback on sm */} {navItems.find((item) => item.href === pathname)?.label ?? "Menu"} setMobileOpen((open) => !open)} className="px-3 py-2 text-sm font-medium text-gray-200 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors" aria-expanded={mobileOpen} aria-controls="mobile-nav-menu" > {mobileOpen ? "Close" : "Menu"} {/* Desktop nav */} {navItems.map((item) => ( ))} {/* Mobile dropdown */} {mobileOpen && ( {navItems.map((item) => ( ))} )} ); }