import { Link, useLocation } from "react-router" import { LogIn, LogOut, Menu, X } from "lucide-react" import { useState } from "react" import { useAuth } from "@/app/context/auth-context" const navLinks = [ { href: "/forms", label: "My Forms" }, ] export function Navbar() { const { pathname } = useLocation() const [mobileOpen, setMobileOpen] = useState(false) const { user, logout } = useAuth() const isAuthPage = pathname === "/login" || pathname === "/register" const isLoggedIn = !!user return (
{!isAuthPage && isLoggedIn && mobileOpen && (
{navLinks.map((link) => ( setMobileOpen(false)} className={`block rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-secondary ${ pathname === link.href ? "text-primary" : "text-muted-foreground" }`} > {link.label} ))}
{user?.email}
)}
) }