'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { cn } from '@/lib/utils'; import { LayoutDashboard, FileText, Calculator, Settings, LogOut, } from 'lucide-react'; import { useAuthStore } from '@/stores/auth-store'; import { logout } from '@/lib/api/auth'; import { useRouter } from 'next/navigation'; const navigation = [ { name: 'Dashboard', href: '/dashboard', icon: LayoutDashboard }, { name: 'CFDI', href: '/cfdi', icon: FileText }, { name: 'Impuestos', href: '/impuestos', icon: Calculator }, { name: 'Configuracion', href: '/configuracion', icon: Settings }, ]; export function Sidebar() { const pathname = usePathname(); const router = useRouter(); const { user, logout: clearAuth } = useAuthStore(); const handleLogout = async () => { try { await logout(); } catch { // Ignore errors } finally { clearAuth(); router.push('/login'); } }; return ( ); }