import { MyBetaModalFormProps, renderTextHelper } from '@/common';
import {
  AssetProjectsChargeEnum,
  AssetProjectsEntrustTypeEnum,
  AssetProjectsPropertyTypeEnum,
  AssetProjectsStatusEnum,
} from '@/gen/Enums';
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
import { Space } from 'antd';
import AssetUpdate from '../modals/AssetUpdate';
import BindCompany from '../modals/BindCompany';

export default function info(props: MyBetaModalFormProps) {
  return (
    <Space direction="vertical" style={{ width: '100%' }}>
      <ProCard extra={props.extra}>
        <ProDescriptions bordered>
          <ProDescriptions.Item label="项目名称" span={2}>
            <Space>
              <div>
                【{props?.item?.id}】{props?.item?.name}
              </div>
              <AssetUpdate
                item={props?.item}
                title="项目"
                reload={props?.reload}
              />
            </Space>
          </ProDescriptions.Item>
          <ProDescriptions.Item label="项目别名">
            {props?.item?.alias_name}
          </ProDescriptions.Item>
          {/* <ProDescriptions.Item label="项目编码">
            {props?.item?.code}
          </ProDescriptions.Item> */}
          <ProDescriptions.Item label="项目状态">
            <renderTextHelper.Tag
              Enums={AssetProjectsStatusEnum}
              value={props?.item?.status}
              key="status"
            />
          </ProDescriptions.Item>
          <ProDescriptions.Item label="项目类型">
            <renderTextHelper.Tag
              Enums={AssetProjectsPropertyTypeEnum}
              value={props?.item?.property_type}
              key="property_type"
            />
          </ProDescriptions.Item>
          <ProDescriptions.Item label="收费方式">
            <renderTextHelper.Tag
              Enums={AssetProjectsChargeEnum}
              value={props?.item?.charge}
              key="charge"
            />
          </ProDescriptions.Item>
          <ProDescriptions.Item label="委托类型">
            <renderTextHelper.Tag
              Enums={AssetProjectsEntrustTypeEnum}
              value={props?.item?.entrust_type}
              key="entrust_type"
            />
          </ProDescriptions.Item>
          <ProDescriptions.Item label="接管日期">
            {props?.item?.takeover_date}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="封园日期">
            {props?.item?.closure_date}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="项目地址" span={3}>
            {props?.item?.province || ''}
            {props?.item?.city || ''}
            {props?.item?.district || ''}
            {props?.item?.address || ''}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="创建日期" span={3}>
            {props?.item?.created_at}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="最近修改" span={3}>
            {props?.item?.updated_at}
          </ProDescriptions.Item>
        </ProDescriptions>
      </ProCard>
      <ProCard extra={props.extra}>
        <ProDescriptions bordered>
          <ProDescriptions.Item label="关联机构" span={3}>
            <Space>
              <div>
                【{props?.item?.company?.id}】{props?.item?.company?.name}
              </div>
              <BindCompany
                item={props?.item}
                title="项目"
                reload={props?.reload}
              />
            </Space>
          </ProDescriptions.Item>
        </ProDescriptions>
      </ProCard>
    </Space>
  );
}
