"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.CoalitionStampsProgress = void 0;
var _react = _interopRequireDefault(require("react"));
var _svgs = require("../../svgs");
var _utils = require("./../../utils");
require("./CoalitionStampsProgress.css");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const CoalitionStampsProgress = _ref => {
  let {
    used,
    needed,
    drawables = 5,
    footer = true
  } = _ref;
  const draw = [];
  const limit = needed >= drawables ? drawables : needed;
  for (let i = 0; i < limit; i++) {
    const k = "".concat(i, "_").concat((0, _utils.makeId)(5));
    let status = used >= needed ? 2 : i < used ? 1 : 0;
    if (drawables > 5 && i === 5) draw.push( /*#__PURE__*/_react.default.createElement("div", {
      key: "".concat(i, "_").concat((0, _utils.makeId)(5)),
      style: {
        margin: 5
      }
    }));
    draw.push( /*#__PURE__*/_react.default.createElement(_svgs.CircleCheck, {
      status: status,
      key: k
    }));
  }
  const remanent = needed - drawables;
  if (remanent <= 0) return draw;
  draw.push( /*#__PURE__*/_react.default.createElement("div", {
    key: "remanent_".concat((0, _utils.makeId)(5)),
    className: "coalition-stamps-progress-".concat(footer ? "footer" : "body"),
    style: {
      color: used >= needed ? "#FFFFFF" : "#4A90E2"
    }
  }, "+".concat(remanent)));
  return draw;
};
exports.CoalitionStampsProgress = CoalitionStampsProgress;