"use client"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { useState } from "react"; import { Menu } from "@base-ui/react/menu"; import { ChevronDown } from "lucide-react"; import { authClient } from "@/lib/auth-client"; import { cn } from "@/lib/utils"; /** A link in a navigation bar, marked when it's the current page (or, unless exact, a page under it). */ export function NavLink({ href, exact = false, children, }: { href: string; exact?: boolean; children: React.ReactNode; }) { const pathname = usePathname(); const here = pathname === href || (!exact && pathname.startsWith(href + "/")); return ( {children} ); } /** The signed-in person's menu: their picture and name, opening their pages and signing out. */ export function ProfileMenu({ username, picture, console }: { username: string; picture: string | null; console: boolean }) { const router = useRouter(); const [signingOut, setSigningOut] = useState(false); const item = "flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[highlighted]:bg-muted"; return (