import * as DropdownMenu from '@radix-ui/react-dropdown-menu'; import { DotsHorizontalIcon } from '@radix-ui/react-icons'; import { writeText } from '@tauri-apps/api/clipboard'; import { useRouter } from 'next/router'; import { nip19 } from 'nostr-tools'; import { memo } from 'react'; export const ProfileMenu = memo(function ProfileMenu({ pubkey }: { pubkey: string }) { const router = useRouter(); const viewProfile = () => { router.push(`/profile/${pubkey}`); }; const updateProfile = () => { router.push('/profile/update'); }; const copyPubkey = async () => { const npub = nip19.npubEncode(pubkey); await writeText(npub); }; return ( viewProfile()} className="group relative flex h-[30px] select-none items-center rounded px-1 pl-6 text-sm leading-none text-zinc-100 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-zinc-700 data-[highlighted]:text-fuchsia-400 data-[disabled]:text-zinc-400" > View profile updateProfile()} className="group relative flex h-[30px] select-none items-center rounded px-1 pl-6 text-sm leading-none text-zinc-100 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-zinc-700 data-[highlighted]:text-fuchsia-400 data-[disabled]:text-zinc-400" > Update profile copyPubkey()} className="group relative flex h-[30px] select-none items-center rounded px-1 pl-6 text-sm leading-none text-zinc-100 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-zinc-700 data-[highlighted]:text-fuchsia-400 data-[disabled]:text-zinc-400" > Copy public key Log out ); });