import { MyBetaModalFormProps, renderTextHelper } from '@/common';
import {
  HouseMetersMeterTypeEnum,
  HouseMetersUsageTypeEnum,
} from '@/gen/Enums';
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
import { Space } from 'antd';

export default function info(props: MyBetaModalFormProps) {
  const { item } = props;

  return (
    <Space direction="vertical" style={{ width: '100%' }}>
      <ProCard title="基本信息">
        <ProDescriptions bordered>
          <ProDescriptions.Item label="仪表名称">
            <div style={{ fontWeight: 'bold' }}>
              【{item?.id}】{item?.name}
            </div>
          </ProDescriptions.Item>
          <ProDescriptions.Item label="类型">
            <renderTextHelper.Tag
              Enums={HouseMetersMeterTypeEnum}
              value={item?.meter_type}
              key="meter_type"
            />
          </ProDescriptions.Item>
          <ProDescriptions.Item label="使用类型">
            <renderTextHelper.Tag
              Enums={HouseMetersUsageTypeEnum}
              value={item?.usage_type}
              key="usage_type"
            />
          </ProDescriptions.Item>

          <ProDescriptions.Item label="收费标准">
            {item?.charge_standard?.name || '-'}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="初始抄表读数">
            {item?.initial_value}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="初始抄表时间">
            {item?.initial_time}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="最新抄表读数">
            {item?.latest_value}
          </ProDescriptions.Item>

          <ProDescriptions.Item label="最新抄表时间">
            {item?.latest_time}
          </ProDescriptions.Item>

          <ProDescriptions.Item label="备注">
            {item?.remark || '-'}
          </ProDescriptions.Item>
        </ProDescriptions>
      </ProCard>
    </Space>
  );
}
