// components/TopNav.tsx "use client"; import Link from "next/link"; import Image from "next/image"; import { useState } from "react"; import { usePathname } from "next/navigation"; import { useAuth } from "@/context/AuthContext"; import { FeedbackModal } from "@/components/FeedbackModal"; 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; const [feedbackOpen, setFeedbackOpen] = useState(false); 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
)}
setFeedbackOpen(false)} /> ); } export default TopNav;