"use client"; import { useRouter } from "next/navigation"; import { useAuth } from "../auth-context"; import { sharedStyles } from "../styles/shared"; type PageId = "counter" | "sum" | "profile" | "audit"; interface HeaderProps { currentPage: PageId; } interface NavItem { id: PageId; label: string; href: string; regularOnly?: boolean; } const NAV_ITEMS: NavItem[] = [ { id: "counter", label: "Counter", href: "/" }, { id: "sum", label: "Sum", href: "/sum" }, { id: "profile", label: "My Profile", href: "/profile", regularOnly: true }, ]; export function Header({ currentPage }: HeaderProps) { const { user, logout, hasRole } = useAuth(); const router = useRouter(); const isRegularUser = hasRole("regular"); const handleLogout = async () => { await logout(); router.push("/login"); }; if (!user) return null; // For audit page (admin), show only the current page label if (currentPage === "audit") { return (