"use strict";

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

var _getLocale = require("../../utils/getLocale");

var _tooltip = _interopRequireDefault(require("../tooltip"));

var _okrClassifyNuoCopy = _interopRequireDefault(require("./assets/okr-classify-nuo-copy.svg"));

var _okrClassifyYuanCopy = _interopRequireDefault(require("./assets/okr-classify-yuan-copy.svg"));

require("./index.css");

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

var OkrClassifyImgMapping = function OkrClassifyImgMapping(okrClassify) {
  return {
    1: {
      icon: _okrClassifyNuoCopy["default"],
      text: (0, _getLocale.getLocale)('OKR_MyO_Es_Commitment')
    },
    2: {
      icon: _okrClassifyYuanCopy["default"],
      text: (0, _getLocale.getLocale)('OKR_MyO_Es_Visiontype')
    }
  }[okrClassify];
};

var OkrTypeIcon = function OkrTypeIcon(_ref) {
  var okrClassify = _ref.okrClassify;
  if (!okrClassify) return '';
  var iconConfig = OkrClassifyImgMapping(okrClassify);
  return /*#__PURE__*/React.createElement(_tooltip["default"], {
    overlay: iconConfig.text,
    placement: "top"
  }, /*#__PURE__*/React.createElement("span", {
    className: "tita-okr-type-icon",
    style: {
      backgroundImage: "url(".concat(iconConfig.icon, ")")
    }
  }));
};

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