Liferay.Loader.define("portal-workflow-metrics-web@2.0.46/js/components/process-list-page/ProcessListPageTable.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/table', 'frontend-js-react-web$react', '../../shared/components/list/ListHeadItem.es', '../../shared/components/router/ChildLink.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 _ChildLink = _interopRequireDefault(require("../../shared/components/router/ChildLink.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 instanceCount = _ref.instanceCount,
          onTimeInstanceCount = _ref.onTimeInstanceCount,
          overdueInstanceCount = _ref.overdueInstanceCount,
          _ref$process = _ref.process,
          id = _ref$process.id,
          title = _ref$process.title;
      return (/*#__PURE__*/_react.default.createElement(_table.default.Row, null, /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          className: "table-title"
        }, /*#__PURE__*/_react.default.createElement(_ChildLink.default, {
          to: "/metrics/".concat(id)
        }, title)), /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          className: "text-right"
        }, overdueInstanceCount), /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          className: "text-right"
        }, onTimeInstanceCount), /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          className: "text-right"
        }, instanceCount))
      );
    };

    var Table = function Table(_ref2) {
      var items = _ref2.items;
      var onTimeTitle = Liferay.Language.get('on-time');
      var overdueTitle = Liferay.Language.get('overdue');
      var processNameTitle = Liferay.Language.get('process-name');
      var totalPendingTitle = Liferay.Language.get('total-pending');
      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: '70%'
          }
        }, /*#__PURE__*/_react.default.createElement(_ListHeadItem.default, {
          name: "title",
          title: processNameTitle
        })), /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          headingCell: true,
          style: {
            width: '10%'
          }
        }, /*#__PURE__*/_react.default.createElement(_ListHeadItem.default, {
          name: "overdueInstanceCount",
          title: overdueTitle
        })), /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          headingCell: true,
          style: {
            width: '10%'
          }
        }, /*#__PURE__*/_react.default.createElement(_ListHeadItem.default, {
          name: "onTimeInstanceCount",
          title: onTimeTitle
        })), /*#__PURE__*/_react.default.createElement(_table.default.Cell, {
          headingCell: true,
          style: {
            width: '10%'
          }
        }, /*#__PURE__*/_react.default.createElement(_ListHeadItem.default, {
          name: "instanceCount",
          title: totalPendingTitle
        })))), /*#__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=ProcessListPageTable.es.js.map
  }
});
//# sourceMappingURL=ProcessListPageTable.es.js.map