Liferay.Loader.define("portal-workflow-metrics-web@2.0.42/js/components/process-metrics/performance-by-assignee-card/PerformanceByAssigneeCardTable.es", ['module', 'exports', 'require', 'frontend-js-react-web$react', '../../../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 _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    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 _react["default"].createElement("tr", null, _react["default"].createElement("td", {
        className: "assignee-name border-0",
        "data-testid": "assigneeProfileInfo"
      }, _react["default"].createElement(_UserAvatar["default"], {
        className: "mr-3",
        image: image
      }), _react["default"].createElement("span", {
        "data-testid": "assigneeName"
      }, name || id)), _react["default"].createElement("td", {
        className: "border-0 text-right"
      }, _react["default"].createElement("span", {
        className: "task-count-value",
        "data-testid": "taskCount"
      }, taskCount)), _react["default"].createElement("td", {
        className: "border-0 text-right"
      }, _react["default"].createElement("span", {
        className: "task-count-value",
        "data-testid": "durationTaskAvg"
      }, formattedDuration)));
    };

    var Table = function Table(_ref2) {
      var items = _ref2.items;
      return _react["default"].createElement("div", {
        className: "mb-3 table-responsive table-scrollable"
      }, _react["default"].createElement("table", {
        className: "table table-autofit table-heading-nowrap table-hover table-list"
      }, _react["default"].createElement("thead", null, _react["default"].createElement("tr", null, _react["default"].createElement("th", {
        className: "table-cell-expand table-head-title",
        style: {
          width: '60%'
        }
      }, Liferay.Language.get('assignee-name')), _react["default"].createElement("th", {
        className: "table-head-title text-right",
        style: {
          width: '20%'
        }
      }, Liferay.Language.get('completed-tasks')), _react["default"].createElement("th", {
        className: "table-head-title text-right",
        style: {
          width: '20%'
        }
      }, Liferay.Language.get('average-completion-time')))), _react["default"].createElement("tbody", null, items.map(function (item, index) {
        return _react["default"].createElement(Table.Item, _extends({}, item, {
          key: index
        }));
      }))));
    };

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