"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _CommonIcon = _interopRequireDefault(require("./CommonIcon"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var getImgUrl = function getImgUrl(_ref) {
  var _ref$status = _ref.status,
    status = _ref$status === void 0 ? 3 : _ref$status,
    imgType = _ref.imgType,
    _ref$color = _ref.color,
    color = _ref$color === void 0 ? '' : _ref$color;
  //status: 1-报警 2离线 3正常 4 故障/堵塞
  var bgColor = color || {
    1: '#CE3739',
    // 报警
    2: '#AAAAAD',
    // 离线
    3: '#119FFB',
    // 在线 / 正常
    4: '#CE3739' // 故障/堵塞
  }[status] || '#AAAAAD';
  var icon = new _CommonIcon["default"]({
    bgColor: bgColor,
    canvasIcon: imgType,
    type: 'mobile',
    legendIcon: true
  });
  return icon.getImgUrl();
};
var _default = exports["default"] = function _default(props) {
  var imgType = props.imgType,
    color = props.color,
    _props$status = props.status,
    status = _props$status === void 0 ? 3 : _props$status;
  return /*#__PURE__*/_react["default"].createElement("img", {
    src: getImgUrl({
      imgType: imgType,
      color: color,
      status: status
    }),
    style: {
      width: 16,
      marginRight: '5px'
    },
    alt: ""
  });
};
//# sourceMappingURL=Legend.js.map
