import { MyBetaModalFormProps, renderTextHelper } from '@/common';
import { MyModal } from '@/components/MyModal';
import {
  AssetHousesOrientationEnum,
  AssetHousesOwnershipTypeEnum,
  AssetHousesStatusEnum,
  AssetHousesUsageEnum,
} from '@/gen/Enums';
import { ProCard, ProDescriptions } from '@ant-design/pro-components';

export default function info(props: MyBetaModalFormProps) {
  return (
    <MyModal
      title={props.title || '查看'}
      width="1000px"
      node={
        <ProCard extra={props.extra}>
          <ProDescriptions bordered>
            <ProDescriptions.Item label="房屋全名" span={2}>
              {props?.item?.full_name}
            </ProDescriptions.Item>
            <ProDescriptions.Item label="房号">
              {props?.item?.name}
            </ProDescriptions.Item>
            <ProDescriptions.Item label="楼层">
              {props?.item?.floor}
            </ProDescriptions.Item>
            <ProDescriptions.Item label="房屋用途">
              <renderTextHelper.Tag
                Enums={AssetHousesUsageEnum}
                value={props?.item?.usage}
                key="usage"
              />
            </ProDescriptions.Item>
            <ProDescriptions.Item label="产权性质">
              <renderTextHelper.Tag
                Enums={AssetHousesOwnershipTypeEnum}
                value={props?.item?.ownership_type}
                key="ownership_type"
              />
            </ProDescriptions.Item>
            <ProDescriptions.Item label="建筑面积">
              {props?.item?.built_area}m²
            </ProDescriptions.Item>
            <ProDescriptions.Item label="套内面积">
              {props?.item?.inside_area}m²
            </ProDescriptions.Item>
            <ProDescriptions.Item label="计费面积">
              {props?.item?.chargeable_area}m²
            </ProDescriptions.Item>
            <ProDescriptions.Item label="房屋状态">
              <renderTextHelper.Tag
                Enums={AssetHousesStatusEnum}
                value={props?.item?.status}
                key="status"
              />
            </ProDescriptions.Item>
            <ProDescriptions.Item label="户型">
              {props?.item?.room || ''}房{props?.item?.hall || ''}厅
              {props?.item?.bathroom || ''}卫{props?.item?.kitchen || ''}厨
              {props?.item?.balcony || ''}阳台
            </ProDescriptions.Item>
            <ProDescriptions.Item label="朝向">
              <renderTextHelper.Tag
                Enums={AssetHousesOrientationEnum}
                value={props?.item?.orientation}
                key="orientation"
              />
            </ProDescriptions.Item>
          </ProDescriptions>
        </ProCard>
      }
    />
  );
}
