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

export default function AssetInfo(props: MyBetaModalFormProps) {
  return (
    <MyModal
      title={props.title || '查看'}
      type={props.item?.type || 'primary'}
      width="920px"
      node={
        <Space direction="vertical" style={{ width: '100%' }}>
          <ProCard extra={props.extra}>
            <ProDescriptions bordered>
              <ProDescriptions.Item label="项目名称" span={2}>
                <Space size="large">
                  <div>
                    {props?.item?.name}
                    {props?.item?.alias_name
                      ? `（${props?.item?.alias_name}）`
                      : ''}
                  </div>
                </Space>
              </ProDescriptions.Item>
              <ProDescriptions.Item label="关联机构">
                <Space size="large">
                  <div>{props?.item?.company?.name}</div>
                </Space>
              </ProDescriptions.Item>

              <ProDescriptions.Item label="项目地址" span={2}>
                {props?.item?.province || ''}
                {props?.item?.city || ''}
                {props?.item?.district || ''}
                {props?.item?.address || ''}
              </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={AssetProjectsStatusEnum}
                  value={props?.item?.status}
                  key="status"
                />
              </ProDescriptions.Item>
              <ProDescriptions.Item label="委托类型">
                <renderTextHelper.Tag
                  Enums={AssetProjectsEntrustTypeEnum}
                  value={props?.item?.entrust_type}
                  key="entrust_type"
                />
              </ProDescriptions.Item>
              <ProDescriptions.Item label="收费方式">
                <renderTextHelper.Tag
                  Enums={AssetProjectsChargeEnum}
                  value={props?.item?.charge}
                  key="charge"
                />
              </ProDescriptions.Item>

              <ProDescriptions.Item label="接管日期">
                {props?.item?.takeover_date}
              </ProDescriptions.Item>
              <ProDescriptions.Item label="封园日期">
                {props?.item?.closure_date}
              </ProDescriptions.Item>

              {/* <ProDescriptions.Item label="创建日期">
            {props?.item?.created_at}
          </ProDescriptions.Item> */}
              <ProDescriptions.Item label="最近修改">
                {props?.item?.updated_at}
              </ProDescriptions.Item>
            </ProDescriptions>
          </ProCard>
        </Space>
      }
    />
  );
}
