"use strict";

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

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

require("./index.css");

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

function LineProgress(props) {
  var _props$isShowtext = props.isShowtext,
      isShowtext = _props$isShowtext === void 0 ? true : _props$isShowtext,
      _props$color = props.color,
      color = _props$color === void 0 ? "#419BFF" : _props$color,
      _props$backgroundColo = props.backgroundColor,
      backgroundColor = _props$backgroundColo === void 0 ? "#F0F2F5" : _props$backgroundColo,
      _props$percent = props.percent,
      percent = _props$percent === void 0 ? 0 : _props$percent,
      _props$width = props.width,
      width = _props$width === void 0 ? 64 : _props$width,
      _props$height = props.height,
      height = _props$height === void 0 ? 10 : _props$height,
      _props$textColor = props.textColor,
      textColor = _props$textColor === void 0 ? "#89919f" : _props$textColor;
  var p = percent > 100 ? 100 : percent;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "titaui-progress-wrapper"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "titaui-progress-line",
    style: {
      backgroundColor: backgroundColor,
      height: height,
      width: width,
      borderRadius: "".concat(height / 2, "px") // marginRight: isShowtext ? '8px' : '0'

    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "line-inner",
    style: {
      background: color,
      width: "".concat(p, "%"),
      borderRadius: "0 ".concat(height / 2, "px ").concat(height / 2, "px 0")
    }
  })), isShowtext && /*#__PURE__*/_react["default"].createElement("span", {
    className: "titaui-progress-text",
    style: {
      color: textColor
    }
  }, percent, "%"));
}

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