"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

require("./index.css");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var prefix = 'tita-summary-progress';

var Progress = function Progress(_ref) {
  var _classNames;

  var value = _ref.value,
      status = _ref.status;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])(prefix)
  }, /*#__PURE__*/_react["default"].createElement("p", null, value, "%"), /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(prefix, "__bg"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "__bg--normal"), status === 'normal'), _defineProperty(_classNames, "".concat(prefix, "__bg--risk"), status === 'risk'), _defineProperty(_classNames, "".concat(prefix, "__bg--delay"), status === 'delay'), _classNames)),
    style: {
      width: "".concat(value > 100 ? 100 : value, "%")
    }
  }));
};

var _default = Progress;
exports["default"] = _default;