// import { useMemo } from 'react';
// import VmCustom from '../_components/vm-custom';
// import useGetConfig from '../_hooks/useGetConfig';
import VtxBaseModal from "../vtx-base-modal";
import { overViewService, useGetLoadEnumValue } from "./api";
import { Alarm, OverView, Sbzj, TFRD, WGGS, WGXW } from "./components";
import { jsx as _jsx } from "react/jsx-runtime";
var VtxHousingEstateModal = function VtxHousingEstateModal(props) {
  var _props$visible = props.visible,
    visible = _props$visible === void 0 ? false : _props$visible,
    onCancel = props.onCancel,
    _props$theme = props.theme,
    theme = _props$theme === void 0 ? '' : _props$theme,
    id = props.id,
    _props$title = props.title,
    title = _props$title === void 0 ? '' : _props$title;
  var PREFIX = 'estate';
  var tabs = [{
    key: 'base',
    title: '总览信息'
  }, {
    key: 'wgrgs',
    title: '违规人公示'
  }, {
    key: 'tfrd',
    title: '居民投放热度'
  }, {
    key: 'wgxw',
    title: '居民违规行为'
  }, {
    key: 'alarm',
    title: '报警时间分析'
  }, {
    key: 'sbzj',
    title: '设备自检'
  }];
  // const { tabsData } = useGetConfig('sdydTfd', tabs);
  // 小区基本信息
  var basicInfo = overViewService.useEstateStatistics({
    throwPointId: id
  });
  // 系统配置获取垃圾类型配置的图标
  var garbageIcons = overViewService.useGetGarbageIcons();
  // 小区关联投放点
  var throwPoints = overViewService.useThrowPoints({
    throwPointId: id
  });
  // 小区业务包code
  var serviceList = useGetLoadEnumValue(id) || [];

  // const tabsList = useMemo(() => {
  //   let tabsList = tabsData;
  //   if (!serviceList.includes('THROW')) {
  //     tabsList = tabsList.filter((ele) => ele.key !== 'tfrd');
  //   }

  //   return tabsList;
  // }, [JSON.stringify(tabsData), JSON.stringify(serviceList)]);

  var tabContents = {
    base: /*#__PURE__*/_jsx(OverView, {
      classPrefix: PREFIX,
      id: id,
      basicInfo: basicInfo,
      throwPoints: throwPoints,
      serviceList: serviceList,
      garbageIcons: garbageIcons
    }),
    wgrgs: /*#__PURE__*/_jsx(WGGS, {
      classPrefix: PREFIX,
      id: id,
      throwPoints: throwPoints,
      serviceList: serviceList
    }),
    tfrd: /*#__PURE__*/_jsx(TFRD, {
      classPrefix: PREFIX,
      id: id
    }),
    alarm: /*#__PURE__*/_jsx(Alarm, {
      classPrefix: PREFIX,
      id: id
    }),
    wgxw: /*#__PURE__*/_jsx(WGXW, {
      classPrefix: PREFIX,
      id: id,
      throwPoints: throwPoints,
      serviceList: serviceList
    }),
    sbzj: /*#__PURE__*/_jsx(Sbzj, {
      classPrefix: PREFIX,
      id: id,
      title: title
    })
  };
  // 自定义页签可配置多个，
  // if (tabsData?.length) {
  //   tabsData.forEach((ele) => {
  //     if (ele.url) {
  //       tabContents[ele.key] = <VmCustom id={id} url={ele?.url} />;
  //     }
  //   });
  // }
  return /*#__PURE__*/_jsx(VtxBaseModal, {
    title: title,
    theme: theme,
    width: 1344,
    tabs: tabs,
    contents: tabContents,
    visible: visible,
    onCancel: onCancel
  });
};
export default VtxHousingEstateModal;