import { useViewerID } from '@self.id/framework' import { Avatar, Box, Button, DropButton, Spinner, Text } from 'grommet' import Link from 'next/link' import Image from 'next/image' import { useRouter } from 'next/router' import { forwardRef, useCallback, useMemo, useState } from 'react' import type { ForwardedRef } from 'react' import { useAuthConnection, useViewerProfile } from '../../hooks' import linkIcon from '../../images/icons/link.svg' import { formatDID, getImageURL } from '../../utils' import AvatarPlaceholder from '../AvatarPlaceholder' type DisplayAvatarProps = { did?: string label: string loading?: boolean src?: string | null } function DisplayAvatar({ did, label, loading, src }: DisplayAvatarProps) { const avatar = loading ? ( ) : src ? ( ) : ( ) return ( {avatar} {label} ) } type MenuButtonProps = { href?: string label: string loading?: boolean onClick?: () => void } const MenuButton = forwardRef(function MenuButtonComponent( { label, loading, ...props }: MenuButtonProps, ref: ForwardedRef ) { return (