"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
var _loader = _interopRequireDefault(require("../../atom/loader"));
var _style = _interopRequireDefault(require("./style.css"));
var _types = require("./types");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
const buildIcon = progression => {
  if (progression === undefined) return null;
  if (progression === 100) return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.icon
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusCheckCircle2, null));
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.loader
  }, /*#__PURE__*/_react.default.createElement(_loader.default, {
    theme: "coorpmanager"
  }));
};
const BulkInfos = ({
  mainText,
  subText,
  imageUrl,
  progression,
  firstButtonLink,
  secondButtonLink
}) => /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.container
}, /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.header
}, imageUrl && typeof imageUrl === 'string' ? /*#__PURE__*/_react.default.createElement("img", {
  className: _style.default.img,
  src: imageUrl,
  "aria-hidden": "true"
}) : null, buildIcon(progression)), /*#__PURE__*/_react.default.createElement("p", {
  className: _style.default.mainText
}, `${mainText} ${progression === undefined || progression === 100 ? '' : `${progression}%`}`), /*#__PURE__*/_react.default.createElement("p", {
  className: _style.default.subText
}, subText), /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.buttonsContainer
}, firstButtonLink ? /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.buttonContainer
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, firstButtonLink, {
  className: _style.default.button
}))) : null, secondButtonLink ? /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.buttonContainer
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, secondButtonLink, {
  className: _style.default.button
}))) : null));
BulkInfos.propTypes = process.env.NODE_ENV !== "production" ? _types.propTypes : {};
var _default = exports.default = BulkInfos;
//# sourceMappingURL=index.js.map