import PropTypes from 'prop-types';
import Avatar from '@mui/material/Avatar';
import useBlockletLogo from '../hooks/use-blocklet-logo';
import { jsx as _jsx } from "react/jsx-runtime";
export default function BlockletAppAvatar({
  blocklet,
  style = {},
  size = 40,
  ...rest
}) {
  const logoUrl = useBlockletLogo({
    blocklet,
    square: true
  });
  const {
    variant
  } = rest;
  return /*#__PURE__*/_jsx(Avatar, {
    variant: variant || 'square',
    style: Object.assign({
      backgroundColor: 'transparent',
      width: size,
      height: size,
      borderRadius: 10
    }, style),
    ...rest,
    children: /*#__PURE__*/_jsx("img", {
      src: logoUrl,
      alt: "",
      style: {
        width: size
      }
    })
  });
}
BlockletAppAvatar.propTypes = {
  blocklet: PropTypes.object.isRequired,
  style: PropTypes.object,
  size: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
};