"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = AvatarList;

var _react = _interopRequireDefault(require("react"));

var _img_avatar_default = _interopRequireDefault(require("../../../../../assets/imgs/img_avatar_default.png"));

require("./index.less");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

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["default"].createElement("div", {
    className: "new-avatar-list"
  }, list && list.length > 0 && list.slice(0, num).map(function (v, i) {
    return /*#__PURE__*/_react["default"].createElement("img", {
      alt: "",
      key: "avatar-".concat(i),
      src: v.img || _img_avatar_default["default"],
      onError: function onError(e) {
        e.target.src = _img_avatar_default["default"];
      }
    });
  }), showAdd && /*#__PURE__*/_react["default"].createElement("div", null, "+"));
}