Liferay.Loader.define("portal-workflow-metrics-web@2.0.46/js/components/performance-by-assignee-page/PerformanceByAssigneePageTable.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/table', 'frontend-js-react-web$react', '../../shared/components/list/ListHeadItem.es', '../../shared/components/user-avatar/UserAvatar.es', '../../shared/util/duration.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.Table = void 0;

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

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

    var _ListHeadItem = _interopRequireDefault(require("../../shared/components/list/ListHeadItem.es"));

    var _UserAvatar = _interopRequireDefault(require("../../shared/components/user-avatar/UserAvatar.es"));

    var _duration = require("../../shared/util/duration.es");

    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);
    }

    var Item = function Item(_ref) {
      var _ref$assignee = _ref.assignee,
          image = _ref$assignee.image,
          name = _ref$assignee.name,
          durationTaskAvg = _ref.durationTaskAvg,
          id = _ref.id,
          taskCount = _ref.taskCount;
      var formattedDuration = (0, _duration.formatDuration)(durationTaskAvg);
      return (/*#__PURE__*/_react.default.createElement(_table.default.Row, null, /*#__PURE__*/_react.default.createElement(_table.default.Cell, null, /*#__PURE__*/_react.default.createElement(_UserAvatar.default, {
          className: "mr-3",
          image: image
        }), /*#__PURE__*/_react.default.createElement("span", null, name || id)), /*#__PURE__*/_react.default.createElement(_table.default.Cell, null, /*#__PURE__*/_react.default.createElement("span", {
          className: "task-count-value text-right"
        }, taskCount)), /*#__PURE__*/_react.default.createElement(_table.default.Cell, null, /*#__PURE__*/_react.default.createElement("span", {
          className: "task-count-value text-right"
        }, formattedDuration)))
      );
    };

    var Table = function Table(_ref2) {
      var items = _ref2.items;
      return (/*#__PURE__*/_react.default.createElement(_table.default, null, /*#__PURE__*/_react.default.createElement(_table.default.Head, null, /*#__PURE__*/_react.default.createElement(_table.default.Row, null, /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          headingCell: true,
          style: {
            width: '60%'
          }
        }, Liferay.Language.get('assignee-name')), /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          headingCell: true,
          style: {
            width: '20%'
          }
        }, /*#__PURE__*/_react.default.createElement(_ListHeadItem.default, {
          name: "taskCount",
          title: Liferay.Language.get('completed-tasks')
        })), /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          headingCell: true,
          style: {
            width: '20%'
          }
        }, /*#__PURE__*/_react.default.createElement(_ListHeadItem.default, {
          name: "durationTaskAvg",
          title: Liferay.Language.get('average-completion-time')
        })))), /*#__PURE__*/_react.default.createElement(_table.default.Body, null, items.map(function (item, index) {
          return (/*#__PURE__*/_react.default.createElement(Table.Item, _extends({}, item, {
              key: index
            }))
          );
        })))
      );
    };

    exports.Table = Table;
    Table.Item = Item;
    //# sourceMappingURL=PerformanceByAssigneePageTable.es.js.map
  }
});
//# sourceMappingURL=PerformanceByAssigneePageTable.es.js.map