"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
require("./style");
var _antd = require("antd");
var _icons = require("@ant-design/icons");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**
 * 内部组件-左侧图标，右侧名称和数值
 */

var ImageText = function ImageText(props) {
  var src = props.src,
    name = props.name,
    value = props.value,
    unit = props.unit,
    specialCase = props.specialCase,
    _props$color = props.color,
    color = _props$color === void 0 ? '' : _props$color,
    style = props.style,
    values = props.values,
    units = props.units,
    tooltip = props.tooltip;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "vm-image-text-item",
    style: style
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: src
  }), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "vm-image-text-item--name",
    title: name
  }, /*#__PURE__*/_react["default"].createElement(_antd.Space, null, /*#__PURE__*/_react["default"].createElement("span", null, name), tooltip && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
    title: tooltip
  }, /*#__PURE__*/_react["default"].createElement(_icons.QuestionCircleOutlined, null)))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vm-image-text-item--value ".concat(color)
  }, specialCase ? (/*#__PURE__*/_react["default"].createElement("span", null, specialCase)) : values ? values.map(function (item, index) {
    return /*#__PURE__*/_react["default"].createElement("label", {
      key: index
    }, /*#__PURE__*/_react["default"].createElement("span", null, item || 0), units && units[index], index !== values.length - 1 && '/');
  }) : (/*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", null, value || 0), unit)))));
};
var _default = exports["default"] = ImageText;
//# sourceMappingURL=index.js.map
