Liferay.Loader.define("portal-workflow-metrics-web@2.0.59/js/components/process-metrics/completion-velocity/CompletionVelocityCardBody.es", ['module', 'exports', 'require', 'frontend-js-react-web$react', '../../../shared/components/Panel.es', '../../../shared/components/content-view/ContentView.es', '../../../shared/components/list/ReloadButton.es', '../../../shared/util/numeral.es', './VelocityChart.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.Body = void 0;

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

    var _Panel = _interopRequireDefault(require("../../../shared/components/Panel.es"));

    var _ContentView = _interopRequireDefault(require("../../../shared/components/content-view/ContentView.es"));

    var _ReloadButton = _interopRequireDefault(require("../../../shared/components/list/ReloadButton.es"));

    var _numeral = require("../../../shared/util/numeral.es");

    var _VelocityChart = _interopRequireDefault(require("./VelocityChart.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 Body = function Body(props) {
      var statesProps = {
        errorProps: {
          actionButton: /*#__PURE__*/_react.default.createElement(_ReloadButton.default, null),
          className: 'mb-3 mt-5 py-8',
          hideAnimation: true,
          message: Liferay.Language.get('there-was-a-problem-retrieving-data-please-try-reloading-the-page'),
          messageClassName: 'small'
        },
        loadingProps: {
          className: 'mb-5 mt-4 py-8'
        }
      };
      return (/*#__PURE__*/_react.default.createElement(_Panel.default.Body, {
          elementClasses: "pt-0"
        }, /*#__PURE__*/_react.default.createElement(_ContentView.default, statesProps, props.data ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Body.Info, props), /*#__PURE__*/_react.default.createElement(_VelocityChart.default, _extends({
          velocityData: props.data
        }, props))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)))
      );
    };

    exports.Body = Body;

    var Info = function Info(_ref) {
      var data = _ref.data,
          velocityUnit = _ref.velocityUnit;
      var formattedValue = (0, _numeral.formatNumber)(data.value, '0[.]00');
      return (/*#__PURE__*/_react.default.createElement("div", {
          className: "pb-2"
        }, /*#__PURE__*/_react.default.createElement("span", {
          className: "velocity-value"
        }, formattedValue), /*#__PURE__*/_react.default.createElement("span", {
          className: "velocity-unit"
        }, velocityUnit.name))
      );
    };

    Body.Info = Info;
    //# sourceMappingURL=CompletionVelocityCardBody.es.js.map
  }
});
//# sourceMappingURL=CompletionVelocityCardBody.es.js.map