"use client"; import { usePathname, useRouter } from "next/navigation"; import { navItems } from "@/lib/navigation"; import { cn } from "@/lib/utils"; import { useWebSocket } from "@/lib/ws/context"; export function AppSidebar() { const pathname = usePathname(); const router = useRouter(); const { status } = useWebSocket(); const isActive = (prefix: string) => { if (prefix === "/dashboard") return pathname === "/dashboard"; return pathname.startsWith(prefix); }; const connectionDot = { connected: "bg-green-500", connecting: "bg-yellow-500 animate-pulse", disconnected: "bg-destructive", error: "bg-destructive", }[status]; const connectionLabel = { connected: "Connected", connecting: "Connecting", disconnected: "Disconnected", error: "Error", }[status]; return ( ); }