import { Avatar } from '@mui/material';
import { stringToColor, initials } from '@/utils/format';

// ==============================|| INITIALS AVATAR ||============================== //

export default function UserAvatar({ name = '', size = 32, sx }) {
  return (
    <Avatar sx={{ width: size, height: size, bgcolor: stringToColor(name), fontSize: size * 0.42, ...sx }}>
      {initials(name)}
    </Avatar>
  );
}
