"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useState, useEffect } from "react"; const NAV_ITEMS = [ { href: "/transactions", label: "Transactions", icon: "receipt" }, { href: "/orders", label: "Orders", icon: "package" }, { href: "/statements", label: "Statements", icon: "file-text" }, { href: "/trips", label: "Trips", icon: "map-pin" }, { href: "/shared", label: "Shared", icon: "users" }, { href: "/budget", label: "Analytics", icon: "bar-chart" }, { href: "/insights", label: "Insights", icon: "lightbulb" }, { href: "/merchants", label: "Merchants", icon: "store" }, { href: "/tags", label: "Tags", icon: "tag" }, { href: "/rules", label: "Rules", icon: "settings" }, { href: "/reconcile", label: "Reconcile", icon: "git-merge" }, ]; const ICONS: Record = { receipt: ( ), "file-text": ( ), "map-pin": ( ), users: ( ), "bar-chart": ( ), tag: ( ), settings: ( ), lightbulb: ( ), "git-merge": ( ), package: ( ), store: ( ), }; export function Sidebar() { const pathname = usePathname(); const [open, setOpen] = useState(false); // Close drawer on route change useEffect(() => { setOpen(false); }, [pathname]); // Prevent body scroll when drawer is open useEffect(() => { if (open) { document.body.style.overflow = "hidden"; return () => { document.body.style.overflow = ""; }; } }, [open]); const navContent = ( <>

Finance.

); return ( <> {/* Mobile header bar */}
Finance.
{/* Mobile drawer overlay */} {open && (
setOpen(false)} /> )} {/* Mobile drawer */} {/* Desktop sidebar — unchanged */} ); }