"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = Total;
var _react = _interopRequireDefault(require("react"));
require("./index.less");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
var classnames = function classnames(name) {
  if (name) {
    return "ol-map-Total-".concat(name);
  }
  return "ol-map-Total";
};
var TotalItem = function TotalItem(props) {
  var label = props.label,
    value = props.value,
    unit = props.unit,
    style = props.style;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: classnames('totalItem'),
    style: style
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: classnames('totalItem-value')
  }, value, unit && /*#__PURE__*/_react["default"].createElement("span", {
    className: classnames('totalItem-unit')
  }, unit)), /*#__PURE__*/_react["default"].createElement("div", {
    className: classnames('totalItem-label_')
  }, label));
};
function Total(props) {
  var options = props.options,
    optionsMain = props.optionsMain;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: classnames('total')
  }, optionsMain && /*#__PURE__*/_react["default"].createElement(TotalItem, _extends({
    key: optionsMain.label
  }, optionsMain, {
    style: {
      width: '33%',
      display: 'flex',
      flexDirection: 'column',
      justifyContent: 'center'
    }
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: classnames('content')
  }, options.map(function (v) {
    return /*#__PURE__*/_react["default"].createElement(TotalItem, _extends({
      key: v.label
    }, v));
  })));
}
//# sourceMappingURL=index.js.map
