import { getConnectorIcon } from 'nimbus-wallet-management';
import { Wallet } from '@mui/icons-material';
import { Badge } from '@mui/material';
import type { Account } from '../../hooks/useAccount.js';
import { useChain } from '../../hooks/useChain.js';
import type { ToAddress } from '../../types/widget.js';
import { SmallAvatar } from '../SmallAvatar.js';
import {
AvatarDefault,
AvatarDefaultBadge,
AvatarMasked,
} from './Avatar.style.js';
interface AccountAvatarProps {
chainId?: number;
account?: Account;
toAddress?: ToAddress;
empty?: boolean;
}
export const AccountAvatar = ({
chainId,
account,
empty,
toAddress,
}: AccountAvatarProps) => {
const { chain } = useChain(chainId);
const avatar = empty ? (
) : account?.connector || toAddress?.logoURI ? (
{(toAddress?.name || account?.connector?.name)?.[0]}
) : (
);
return (
{chain.name[0]}
) : (
)
}
>
{avatar}
);
};