"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _config = require("./config");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/* eslint-disable react/prop-types */

var prefix = 'ol-map-drainage-pollution-source-result-statistics';
var ResultStatistics = function ResultStatistics(_ref) {
  var _ref$total = _ref.total,
    total = _ref$total === void 0 ? 0 : _ref$total,
    _ref$alarmTotal = _ref.alarmTotal,
    alarmTotal = _ref$alarmTotal === void 0 ? 0 : _ref$alarmTotal,
    _ref$onlineTotal = _ref.onlineTotal,
    onlineTotal = _ref$onlineTotal === void 0 ? 0 : _ref$onlineTotal,
    activeKey = _ref.activeKey,
    setActiveKey = _ref.setActiveKey;
  var list = [{
    name: '全部点位',
    total: total,
    color: '#1677FF',
    key: ''
  }, {
    name: '在线点位',
    total: onlineTotal,
    color: '#00B132',
    key: _config.StatusMap.Online
  }, {
    name: '报警点位',
    total: alarmTotal,
    color: '#FF3A3B',
    key: _config.StatusMap.Error
  }];
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-wrap")
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-title")
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: require('./assets/icon.png'),
    width: 52,
    height: 44
  }), /*#__PURE__*/_react["default"].createElement("span", null, "\u7BA1\u7F51\u6C34\u8D28\u76D1\u6D4B\u70B9")), /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-item-wrap")
  }, list.map(function (item) {
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(prefix, "-item"),
      key: item.key,
      onClick: function onClick() {
        setActiveKey(item.key);
      }
    }, /*#__PURE__*/_react["default"].createElement("div", null, item.name), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(prefix, "-number"),
      style: {
        color: item.color
      }
    }, /*#__PURE__*/_react["default"].createElement("span", null, item.total), /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(prefix, "-unit")
    }, "\u4E2A"), activeKey === item.key && /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(prefix, "-number-line"),
      style: {
        backgroundColor: item.color
      }
    })));
  })));
};
var _default = exports["default"] = ResultStatistics;
//# sourceMappingURL=ResultStatistics.js.map
