import React from 'react';
import _ from 'lodash';
import "./index.less";

var ProgressApp = function ProgressApp(props) {
  var loading = props.loading,
      num = props.num;

  var getContent = function getContent() {
    if (loading) {
      return /*#__PURE__*/React.createElement("div", {
        className: "movingBlock"
      });
    } else if (!_.isNull(num)) {
      return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
        className: "alreadyBlock",
        style: {
          width: "".concat(num, "%")
        }
      }, /*#__PURE__*/React.createElement("div", {
        className: "alreadyMovingBar"
      })), /*#__PURE__*/React.createElement("div", {
        className: "notReachBlock",
        style: {
          width: "".concat(99 - parseInt(num, 10), "%")
        }
      }, /*#__PURE__*/React.createElement("div", {
        className: "notReachMovingBar"
      })));
    }
  };

  return /*#__PURE__*/React.createElement("div", {
    className: "ProgressApp",
    style: {
      background: !_.isNull(num) ? 'rgba(247, 122, 112, 1)' : 'gainsboro'
    }
  }, getContent());
};

export default ProgressApp;