"use client"; import Link from "next/link"; import Image from "next/image"; import { Menu } from "lucide-react"; import { usePathname } from "next/navigation"; import { useAuth } from "@/lib/auth/useAuth"; import { coreNavigation } from "@/lib/navigation"; import { cn } from "@/lib/utils"; type HeaderProps = { onMenuClick: () => void; }; export function Header({ onMenuClick }: HeaderProps) { const pathname = usePathname(); const { user } = useAuth(); const initials = (user?.name ?? "Student") .split(/\s+/) .map((part) => part[0]) .join("") .slice(0, 2) .toUpperCase(); const centerLinks = coreNavigation.filter((item) => item.href === "/tuition" || item.href === "/study-chat" || item.href === "/learn-anything" ); const rightLinks = coreNavigation.filter((item) => item.href === "/sources"); return (
DocDoe AI DocDoe AI Beta
{rightLinks.map((item) => { const active = pathname === item.href || pathname?.startsWith(item.href + "/"); return ( {item.label} ); })} {initials || "ST"}
); }