"use client" import { Link } from "react-router"; import { useLocation } from "react-router"; import { LogOut, Menu, X } from "lucide-react" import { useState } from "react" const navLinks = [ { href: "/forms", label: "My Forms" }, ] export function Navbar() { const { pathname } = useLocation(); const [mobileOpen, setMobileOpen] = useState(false); const isAuthPage = pathname === "/login" || pathname === "/register"; return (
{!isAuthPage && 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} ))}
bagas@example.com setMobileOpen(false)} className="flex items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-secondary" > Logout
)}
) }