import { Link } from "@tanstack/react-router"; import Login from "./OAuthLogin"; import { SearchBox } from "./Search"; import { useCachedProfileJotai } from "@/esav/hooks"; import { useAuth } from "@/providers/OAuthProvider"; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, } from "@radix-ui/react-dropdown-menu"; export default function Header() { const { agent, status } = useAuth(); const did = agent && agent.did && status === "signedIn" ? agent.did : null; const [profile, profileloading] = useCachedProfileJotai(did); const avatarUrl = profile?.profile.avatar?.ref.$link && profile?.pdsUrl ? `${profile.pdsUrl}/xrpc/com.atproto.sync.getBlob?did=${profile.did}&cid=${profile?.profile.avatar?.ref.$link}` : undefined; return (