import { Link, useLocation } from "wouter"; import { LayoutDashboard, Users, Calendar, Settings, FileCheck, Shield, CreditCard, FolderOpen, Database, FileText, } from "lucide-react"; import { cn } from "@/lib/utils"; import { useEffect, useMemo, useState } from "react"; import { useSidebar } from "@/components/ui/sidebar"; const WIDTH_ANIM_MS = 100; export function Sidebar() { const [location] = useLocation(); const { state, openMobile, setOpenMobile } = useSidebar(); // "expanded" | "collapsed" // Delay label visibility until the width animation completes const [showLabels, setShowLabels] = useState(state !== "collapsed"); useEffect(() => { let timer: number | undefined; if (state === "expanded") { timer = window.setTimeout(() => setShowLabels(true), WIDTH_ANIM_MS); } else { setShowLabels(false); } return () => { if (timer !== undefined) { window.clearTimeout(timer); } }; }, [state]); const navItems = useMemo( () => [ { name: "Dashboard", path: "/dashboard", icon: , }, { name: "Appointments", path: "/appointments", icon: , }, { name: "Patients", path: "/patients", icon: , }, { name: "Insurance Eligibility", path: "/insurance-eligibility", icon: , }, { name: "Claims/PreAuth", path: "/claims", icon: , }, { name: "Payments", path: "/payments", icon: , }, { name: "Documents", path: "/documents", icon: , }, { name: "Reports", path: "/reports", icon: , }, { name: "Backup Database", path: "/database-management", icon: , }, { name: "Settings", path: "/settings", icon: , }, ], [] ); return (
); }