import React from 'react';
import defaultImg from '../../../../../assets/imgs/img_avatar_default.png';
import './index.less';
export default function AvatarList(props) {
  var _props$list = props.list,
      list = _props$list === void 0 ? [] : _props$list,
      num = props.num,
      _props$showAdd = props.showAdd,
      showAdd = _props$showAdd === void 0 ? true : _props$showAdd; // const styles = {
  //   marginRight: list.length === 1 ? 'unset' : '',
  //   color: '#fff',
  // };

  return /*#__PURE__*/React.createElement("div", {
    className: "new-avatar-list"
  }, list && list.length > 0 && list.slice(0, num).map(function (v, i) {
    return /*#__PURE__*/React.createElement("img", {
      alt: "",
      key: "avatar-".concat(i),
      src: v.img || defaultImg,
      onError: function onError(e) {
        e.target.src = defaultImg;
      }
    });
  }), showAdd && /*#__PURE__*/React.createElement("div", null, "+"));
}