import { Wallet } from "lucide-react"; import { Link, useLocation } from "react-router-dom"; import { useQuery } from "@tanstack/react-query"; import { getSyncStatus } from "@/lib/api"; import { isNavActive, navSections } from "@/lib/navigation"; import { NavUser } from "@/components/nav-user"; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, useSidebar, } from "@/components/ui/sidebar"; export function AppSidebar(props: React.ComponentProps) { const { pathname } = useLocation(); const { setOpenMobile } = useSidebar(); // Surface stalled ingestion sources as a dot on the Sincronización item. const syncQ = useQuery({ queryKey: ["sync-status"], queryFn: () => getSyncStatus().then((r) => r.data), staleTime: 5 * 60_000, }); const syncWarnings = syncQ.data?.warnings ?? 0; return ( } >
WealthySmart
{navSections.map((section) => ( {section.label} {section.items.map(({ to, icon: Icon, label }) => ( setOpenMobile(false)} /> } > {label} {to === "/sync" && syncWarnings > 0 && ( )} ))} ))}
); }