import { MyBetaModalFormProps } from '@/common';
import { Tabs } from 'antd';
import Activities from '../table/Activities';
import Announcement from '../table/Announcement';
import AssetAccounts from '../table/AssetAccounts';
import MyAssetBuildings from '../table/AssetBuildings';
import AssetGrid from '../table/AssetGrid';
import ChargeStandard from '../table/ChargeStandard';
import ConvenienceServices from '../table/ConvenienceServices';

export default function ProjectConfig(props: MyBetaModalFormProps) {
  // const [data, setShow] = useState<any>({});

  // 注册当前页面为标签页
  // const { addTab } = usePageTabs({
  //   tabKey: `asset-show-${id}`,
  //   tabLabel: data?.name || title || '项目详情',
  // });

  // const loadShow = () => {
  //   Apis.Asset.AssetProjects.Show({ id: props?.item?.id }).then((res) => {
  //     setShow(res?.data);
  //   });
  // };

  // useEffect(() => {
  //   loadShow();
  // }, [props?.item?.id]);

  let items = [
    {
      label: '楼栋管理',
      key: 'asset_buildings',
      closable: false,
      children: <MyAssetBuildings item={props?.item} />,
    },
    {
      label: '楼栋划分',
      key: 'grid',
      closable: false,
      children: <AssetGrid item={props?.item} />,
    },
    {
      label: '收费标准',
      key: 'charge_standard',
      closable: false,
      children: <ChargeStandard item={props?.item} />,
    },
    {
      label: '收款账号',
      key: 'asset_accounts',
      closable: false,
      children: <AssetAccounts item={props?.item} />,
    },
    {
      label: '项目公告',
      key: 'announcement',
      closable: false,
      children: <Announcement item={props?.item} />,
    },
    {
      label: '项目活动',
      key: 'activities',
      closable: false,
      children: <Activities item={props?.item} />,
    },
    {
      label: '便民信息',
      key: 'convenience_services',
      closable: false,
      children: <ConvenienceServices item={props?.item} />,
    },
  ];
  return <Tabs type="card" items={items} />;
}
