'use client'; import { useRouter } from 'next/navigation'; import { logout} from '@/lib/api'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { CheckCircle, FolderOpen, Calendar, MessageSquare, PieChart, User, LogOut, ListTodo } from 'lucide-react'; export default function Header() { const router = useRouter(); const pathname = usePathname(); const handleLogout = async () => { try { await logout(); router.push('/login'); router.refresh(); } catch (error) { console.error('Logout error:', error); router.push('/login'); router.refresh(); } }; // Helper function to check if link is active const isActive = (path: string) => pathname === path; return (
TaskFlow
); }