// components/TopNav.tsx "use client"; import Link from "next/link"; import Image from "next/image"; import { usePathname } from "next/navigation"; import { useAuth } from "@/context/AuthContext"; import ThemeToggle from "@/components/ThemeToggle"; function NavLink({ href, children, title }: { href: string; children: React.ReactNode; title?: string; }) { const pathname = usePathname(); const active = pathname === href || pathname.startsWith(href + '/'); return ( {children} ); } export function TopNav() { const { user, logout, loading } = useAuth(); const isAuthenticated = !!user; return (
{/* Left: Brand / Home */} Battl Builders Logo {/* Centre: primary nav links */} {/* Right side actions */}
{loading ? ( Checking session… ) : isAuthenticated ? ( <> Vault {/* Email/displayName links to Account */} {user.displayName || user.email} ) : (
Log In Join Beta
)}
); } export default TopNav;