import { Link, useNavigate } from "react-router"; import { authClient } from "~/lib/auth-client"; import { Popover, PopoverContent, PopoverTrigger } from "~/components/ui/popover"; import { Button } from "~/components/ui/button"; interface UserMenuProps { name: string | null; email: string; imageUrl: string | null; } export function UserMenu({ name, email, imageUrl }: UserMenuProps) { const navigate = useNavigate(); const initials = name ? name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) : email.slice(0, 2).toUpperCase(); async function handleSignOut() { await authClient.signOut(); navigate("/"); } return (

{name ?? email}

{email}

Profile
); }