"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _vmSubTitle = _interopRequireDefault(require("../../../vm-sub-title"));
var _useSettings2 = _interopRequireDefault(require("../../../vm-hooks/useSettings"));
var _traffic = _interopRequireDefault(require("../../imgs/traffic.png"));
var _stench = _interopRequireDefault(require("../../imgs/stench.png"));
var _temperature = _interopRequireDefault(require("../../imgs/temperature.png"));
var _humidity = _interopRequireDefault(require("../../imgs/humidity.png"));
var _water = _interopRequireDefault(require("../../imgs/water.png"));
var _electric = _interopRequireDefault(require("../../imgs/electric.png"));
var _traffic_light = _interopRequireDefault(require("../../imgs/traffic_light.png"));
var _stench_light = _interopRequireDefault(require("../../imgs/stench_light.png"));
var _temperature_light = _interopRequireDefault(require("../../imgs/temperature_light.png"));
var _humidity_light = _interopRequireDefault(require("../../imgs/humidity_light.png"));
var _water_light = _interopRequireDefault(require("../../imgs/water_light.png"));
var _electric_light = _interopRequireDefault(require("../../imgs/electric_light.png"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function Situation(props) {
  var _a, _b, _c, _d, _e, _f;
  var situationRes = props.situationRes;
  var _useSettings = (0, _useSettings2["default"])(),
    theme = _useSettings.theme;
  var img = {
    light: {
      PersonNum: _traffic_light["default"],
      OdorValue: _stench_light["default"],
      temperature: _temperature_light["default"],
      humidity: _humidity_light["default"],
      WaterUse: _water_light["default"],
      ElecUse: _electric_light["default"]
    },
    blue: {
      PersonNum: _traffic_light["default"],
      OdorValue: _stench_light["default"],
      temperature: _temperature_light["default"],
      humidity: _humidity_light["default"],
      WaterUse: _water_light["default"],
      ElecUse: _electric_light["default"]
    },
    dark: {
      PersonNum: _traffic["default"],
      OdorValue: _stench["default"],
      temperature: _temperature["default"],
      humidity: _humidity["default"],
      WaterUse: _water["default"],
      ElecUse: _electric["default"]
    }
  };
  var data = theme ? [{
    monitorType: 'PersonNum',
    name: '人流量',
    unit: '人次',
    imgSrc: (_a = img[theme]) === null || _a === void 0 ? void 0 : _a['PersonNum'],
    value: 0
  }, {
    monitorType: 'OdorValue',
    name: '臭气值',
    unit: 'PPm',
    imgSrc: (_b = img[theme]) === null || _b === void 0 ? void 0 : _b['OdorValue'],
    value: 0
  }, {
    monitorType: 'temperature',
    name: '温度',
    unit: '℃',
    imgSrc: (_c = img[theme]) === null || _c === void 0 ? void 0 : _c['temperature'],
    value: 0
  }, {
    monitorType: 'humidity',
    name: '湿度',
    unit: '%',
    imgSrc: (_d = img[theme]) === null || _d === void 0 ? void 0 : _d['humidity'],
    value: 0
  }, {
    monitorType: 'WaterUse',
    name: '用水量',
    unit: '吨',
    imgSrc: (_e = img[theme]) === null || _e === void 0 ? void 0 : _e['WaterUse'],
    value: 0
  }, {
    monitorType: 'ElecUse',
    name: '用电量',
    unit: '度',
    imgSrc: (_f = img[theme]) === null || _f === void 0 ? void 0 : _f['ElecUse'],
    value: 0
  }] : [];
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "base-bottom-left"
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u5B9E\u65F6\u8FD0\u884C\u60C5\u51B5"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "base-bottom-situation"
  }, data.map(function (item) {
    var _a;
    var name = item.name,
      unit = item.unit,
      imgSrc = item.imgSrc;
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: "base-bottom-situation--item",
      key: item.monitorType
    }, /*#__PURE__*/_react["default"].createElement("img", {
      src: imgSrc
    }), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
      className: "base-bottom-situation--item-name"
    }, name), /*#__PURE__*/_react["default"].createElement("div", {
      className: "base-bottom-situation--item-value"
    }, /*#__PURE__*/_react["default"].createElement("span", null, ((_a = situationRes.find(function (ele) {
      return ele.monitorType === item.monitorType;
    })) === null || _a === void 0 ? void 0 : _a.value) || 0), unit)));
  })));
}
var _default = exports["default"] = Situation;
//# sourceMappingURL=Situation.js.map
