'use client'; import Link from 'next/link'; import { usePathname, useRouter } from 'next/navigation'; import { motion } from 'framer-motion'; import { useAuth } from '@/context/AuthContext'; import { Brain, Home, BarChart3, Settings, LogIn, LogOut, User, Award } from 'lucide-react'; export default function Navbar() { const pathname = usePathname(); const router = useRouter(); const { user, isAuthenticated, logout } = useAuth(); const isActive = (path: string) => pathname === path; const handleLogout = () => { logout(); router.push('/'); }; return (
{/* Logo */}
InterviewAI {/* Navigation */}
Home Interview Dashboard Results
{/* User Area */}
{isAuthenticated && user ? (
{/* User Badge */}
{user.displayName.charAt(0).toUpperCase()}
{user.displayName.split(' ')[0]}
{/* Settings */} { e.currentTarget.style.color = 'var(--foreground)'; }} onMouseLeave={(e) => { e.currentTarget.style.color = 'var(--muted)'; }} > {/* Logout */}
) : ( Sign In )}
); } function NavLink({ href, active, children, }: { href: string; active: boolean; children: React.ReactNode; }) { return ( { if (!active) { e.currentTarget.style.color = 'var(--foreground)'; e.currentTarget.style.background = 'rgba(255,255,255,0.03)'; } }} onMouseLeave={(e) => { if (!active) { e.currentTarget.style.color = 'var(--muted)'; e.currentTarget.style.background = 'transparent'; } }} > {children} {active && ( )} ); }