function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
import { VmInfoCollection, VmMap } from "../../../_components";
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
var dayObj = {
  1: '一',
  2: '二',
  3: '三',
  4: '四',
  5: '五',
  6: '六',
  7: '日'
};
var Info = function Info(_ref) {
  var _data$location;
  var data = _ref.data;
  var _ref2 = data !== null && data !== void 0 && (_data$location = data.location) !== null && _data$location !== void 0 && _data$location.lngLats ? data.location.lngLats.split(',') : [],
    _ref3 = _slicedToArray(_ref2, 2),
    lng = _ref3[0],
    lat = _ref3[1];
  var mapPoints = lng && lat ? [{
    lng: lng,
    lat: lat,
    icon: 'CC_CSDW',
    name: data.name,
    type: 'point',
    id: data.name
  }] : [];
  var baseInfo = [{
    key: 'divisionName',
    label: '行政区划',
    value: data === null || data === void 0 ? void 0 : data.divisionName
  }, {
    key: 'type',
    label: '垃圾类型',
    value: '餐厨垃圾'
  }, {
    key: 'restaurantNum',
    label: '商户数量',
    value: data === null || data === void 0 ? void 0 : data.restaurantNum
  }, {
    key: 'address',
    label: '地址',
    value: data === null || data === void 0 ? void 0 : data.address
  }, {
    key: 'setTypeStr',
    label: '服务时段',
    value: "".concat((data === null || data === void 0 ? void 0 : data.setTypeStr) || '').concat(data !== null && data !== void 0 && data.setTypeStr ? data.setType === 'fix_day' ? "\uFF0C\u6BCF".concat(data.setValue, "\u5929\u751F\u6210\u4E00\u6B21\u6536\u8FD0\u4EFB\u52A1") : "\uFF0C\u6BCF\u4E2A\u661F\u671F".concat((data.setValue || '').split(',').map(function (day) {
      return dayObj[day];
    }).join('、'), "\u6536\u8FD0") : '')
  }];
  return /*#__PURE__*/_jsxs(_Fragment, {
    children: [/*#__PURE__*/_jsx(VmInfoCollection, {
      data: baseInfo,
      horizontal: true,
      width: "100%"
    }), lng && lat ? /*#__PURE__*/_jsx("div", {
      style: {
        height: 230,
        marginBottom: 16
      },
      children: /*#__PURE__*/_jsx(VmMap, {
        mapPoints: mapPoints,
        mapType: 'wgs84',
        mapCenter: [lng, lat],
        address: data === null || data === void 0 ? void 0 : data.address
      })
    }) : null]
  });
};
export default Info;