'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useJobs } from '@/contexts/JobsContext'; export default function Sidebar() { const pathname = usePathname(); const { jobs } = useJobs(); const navItems = [ { href: '/new', icon: ( ), label: 'New', matchPaths: ['/new'], }, { href: '/jobs', icon: ( ), label: 'Jobs', matchPaths: ['/jobs'], badge: jobs.length > 0 ? jobs.length : undefined, }, { href: '/analytics', icon: ( ), label: 'Analytics', matchPaths: ['/analytics'], }, ]; const isActive = (item: typeof navItems[0]) => { // Check if current path starts with any of the match paths return item.matchPaths.some(path => pathname.startsWith(path)); }; return (