"use strict";

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

var prefix = 'ol-map-analysis-result-statistics';
var ResultStatistics = function ResultStatistics(_ref) {
  var list = _ref.list,
    activeKey = _ref.activeKey,
    setActiveKey = _ref.setActiveKey,
    title = _ref.title,
    icon = _ref.icon;
  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: icon,
    width: 52,
    height: 44
  }), /*#__PURE__*/_react["default"].createElement("span", null, title)), /*#__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=index.js.map
