Liferay.Loader.define("sharing-taglib@2.0.20/collaborators/js/components/UserIcon.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/icon', '@frontend-taglib-clay$clayui/sticker', 'frontend-js-react-web$classnames', 'frontend-js-react-web$prop-types', 'frontend-js-react-web$react'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports["default"] = void 0;

    var _icon = _interopRequireDefault(require("@frontend-taglib-clay$clayui/icon"));

    var _sticker = _interopRequireDefault(require("@frontend-taglib-clay$clayui/sticker"));

    var _classnames = _interopRequireDefault(require("frontend-js-react-web$classnames"));

    var _propTypes = _interopRequireDefault(require("frontend-js-react-web$prop-types"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

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

    function _defineProperty(obj, key, value) {
      if (key in obj) {
        Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
      } else {
        obj[key] = value;
      }return obj;
    }

    var UserIcon = function UserIcon(_ref) {
      var _ref$fullName = _ref.fullName,
          fullName = _ref$fullName === void 0 ? '' : _ref$fullName,
          _ref$portraitURL = _ref.portraitURL,
          portraitURL = _ref$portraitURL === void 0 ? '' : _ref$portraitURL,
          _ref$size = _ref.size,
          size = _ref$size === void 0 ? 'lg' : _ref$size,
          userId = _ref.userId;
      var stickerColor = parseInt(userId, 10) % 10;
      return _react["default"].createElement(_sticker["default"], {
        className: (0, _classnames["default"])('sticker-use-icon', _defineProperty({}, "user-icon-color-".concat(stickerColor), !portraitURL)),
        displayType: "secondary",
        shape: "circle",
        size: size
      }, portraitURL ? _react["default"].createElement("div", {
        className: "sticker-overlay"
      }, _react["default"].createElement("img", {
        alt: "".concat(fullName, "."),
        className: "sticker-img",
        src: portraitURL
      })) : _react["default"].createElement(_icon["default"], {
        symbol: "user"
      }));
    };

    var _default = UserIcon;
    exports["default"] = _default;
    //# sourceMappingURL=UserIcon.es.js.map
  }
});
//# sourceMappingURL=UserIcon.es.js.map