Liferay.Loader.define("frontend-taglib-clay@6.6.5/data_set_display/views/emails_list/EmailsList", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/label', '@frontend-taglib-clay$clayui/list', '@frontend-taglib-clay$clayui/sticker', 'frontend-taglib-clay$classnames', 'frontend-taglib-clay$prop-types', 'frontend-js-react-web$react', '../../data_renderers/ActionsDropdownRenderer'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    function _typeof(obj) {
      "@babel/helpers - typeof";
      if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
        _typeof = function _typeof(obj) {
          return typeof obj;
        };
      } else {
        _typeof = function _typeof(obj) {
          return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
        };
      }return _typeof(obj);
    }

    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

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

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

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

    var _classnames = _interopRequireDefault(require("frontend-taglib-clay$classnames"));

    var _propTypes = _interopRequireDefault(require("frontend-taglib-clay$prop-types"));

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

    var _ActionsDropdownRenderer = _interopRequireDefault(require("../../data_renderers/ActionsDropdownRenderer"));

    function _getRequireWildcardCache() {
      if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {
        return cache;
      };return cache;
    }

    function _interopRequireWildcard(obj) {
      if (obj && obj.__esModule) {
        return obj;
      }if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
        return { default: obj };
      }var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {
        return cache.get(obj);
      }var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {
        if (Object.prototype.hasOwnProperty.call(obj, key)) {
          var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {
            Object.defineProperty(newObj, key, desc);
          } else {
            newObj[key] = obj[key];
          }
        }
      }newObj.default = obj;if (cache) {
        cache.set(obj, newObj);
      }return newObj;
    }

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

    function _extends() {
      _extends = Object.assign || function (target) {
        for (var i = 1; i < arguments.length; i++) {
          var source = arguments[i];for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }return target;
      };return _extends.apply(this, arguments);
    }

    function Email(_ref) {
      var actionDropdownItems = _ref.actionDropdownItems,
          author = _ref.author,
          borderBottom = _ref.borderBottom,
          dataSetDisplayContext = _ref.dataSetDisplayContext,
          date = _ref.date,
          href = _ref.href,
          status = _ref.status,
          subject = _ref.subject,
          summary = _ref.summary;

      var _useContext = (0, _react.useContext)(dataSetDisplayContext),
          openSidePanel = _useContext.openSidePanel;

      return (/*#__PURE__*/_react.default.createElement("li", {
          className: (0, _classnames.default)('bg-white d-flex p-4', borderBottom ? 'border-top-0 border-left-0 border-right-0 border-bottom' : 'border-0')
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "row"
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "col"
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "row"
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "col"
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "row"
        }, author.avatarSrc && /*#__PURE__*/_react.default.createElement("div", {
          className: "col-auto"
        }, /*#__PURE__*/_react.default.createElement(_sticker.default, {
          className: "sticker-user-icon",
          size: "xl"
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "sticker-overlay"
        }, /*#__PURE__*/_react.default.createElement("img", {
          className: "sticker-img",
          src: author.avatarSrc
        })))), /*#__PURE__*/_react.default.createElement("div", {
          className: "col d-flex flex-column justify-content-center"
        }, /*#__PURE__*/_react.default.createElement("small", {
          className: "d-block text-body"
        }, /*#__PURE__*/_react.default.createElement("strong", null, author.name)), /*#__PURE__*/_react.default.createElement("small", {
          className: "d-block"
        }, author.email)))), /*#__PURE__*/_react.default.createElement("div", {
          className: "col-auto d-flex flex-column justify-content-center"
        }, /*#__PURE__*/_react.default.createElement(_label.default, {
          displayType: status.displayStyle || 'success'
        }, status.label)), /*#__PURE__*/_react.default.createElement("div", {
          className: "col-auto d-flex flex-column justify-content-center"
        }, /*#__PURE__*/_react.default.createElement("small", null, date)), /*#__PURE__*/_react.default.createElement("div", {
          className: "col-12"
        }, /*#__PURE__*/_react.default.createElement("h5", {
          className: "mt-3"
        }, /*#__PURE__*/_react.default.createElement("a", {
          href: "#",
          onClick: function handleClickOnSubject(event) {
            event.preventDefault();
            openSidePanel({
              slug: 'email',
              url: href
            });
          }
        }, subject)), /*#__PURE__*/_react.default.createElement("div", null, summary)))), actionDropdownItems.length ? /*#__PURE__*/_react.default.createElement("div", {
          className: "col-auto d-flex flex-column justify-content-center"
        }, /*#__PURE__*/_react.default.createElement(_ActionsDropdownRenderer.default, {
          actions: actionDropdownItems
        })) : null))
      );
    }

    Email.defaultProps = {
      actionItems: []
    };

    function EmailsList(_ref2) {
      var dataSetDisplayContext = _ref2.dataSetDisplayContext,
          items = _ref2.items;

      var _useContext2 = (0, _react.useContext)(dataSetDisplayContext),
          style = _useContext2.style;

      return (/*#__PURE__*/_react.default.createElement(_list.default, {
          className: (0, _classnames.default)('mb-0', style === 'default' ? 'border-bottom' : 'border')
        }, items.map(function (item, i) {
          return (/*#__PURE__*/_react.default.createElement(Email, _extends({
              key: i
            }, item, {
              borderBottom: i !== items.length - 1,
              dataSetDisplayContext: dataSetDisplayContext
            }))
          );
        }))
      );
    }

    EmailsList.defaultProps = {
      items: []
    };
    var _default = EmailsList;
    exports.default = _default;
    //# sourceMappingURL=EmailsList.js.map
  }
});
//# sourceMappingURL=EmailsList.js.map