import { Link, useLocation, useNavigate } from "@tanstack/react-router"; import { useAuth } from "@/lib/auth"; import { Button } from "@/components/ui/button"; import { HeaderTimer } from "@/components/timer/header-timer"; import { QuickAddTime, QuickAddExpense } from "@/components/quick-add/quick-add"; import { Briefcase, Users, Receipt, ShieldCheck, LogOut, Scale, LayoutDashboard, Settings, Wallet, FileSignature, FolderArchive, ClipboardList, Contact, } from "lucide-react"; import { cn } from "@/lib/utils"; import type { ReactNode } from "react"; interface NavItem { to: string; label: string; icon: typeof Briefcase; adminOnly?: boolean; } const NAV: NavItem[] = [ { to: "/", label: "Dashboard", icon: LayoutDashboard }, { to: "/clients", label: "Clients", icon: Users }, { to: "/cases", label: "Cases", icon: Briefcase }, { to: "/contacts", label: "Contacts", icon: Contact }, { to: "/status", label: "Status Updates", icon: ClipboardList }, { to: "/collections", label: "Collections", icon: Wallet }, { to: "/documents", label: "Documents", icon: FileSignature }, { to: "/files", label: "Files", icon: FolderArchive }, { to: "/invoices", label: "Invoices", icon: Receipt }, { to: "/admin/users", label: "Users", icon: ShieldCheck, adminOnly: true }, { to: "/settings", label: "Settings", icon: Settings, adminOnly: true }, ]; export function AppShell({ children }: { children: ReactNode }) { const { user, signOut, isAdmin, roles } = useAuth(); const location = useLocation(); const navigate = useNavigate(); const handleSignOut = async () => { await signOut(); navigate({ to: "/login" }); }; return (
{description}
}