import React from 'react'; import Avatar from 'react-avatar'; import { getImageSource } from '../../helpers/getImageSource'; import { AvatarWrapper } from './styles'; type UserAvatarProps = { username: string; avatarUrl?: string; size?: number; asLink?: boolean; margin?: [number, number, number, number]; }; const UserAvatar = ({ username, avatarUrl, size = 32, asLink = false, margin, }: UserAvatarProps) => { return ( {avatarUrl ? ( {`@${username}`} ) : ( // fallback to text avatar )} ); }; export default UserAvatar;