import { MyBetaModalFormProps, renderTextHelper } from '@/common';
import { showTime } from '@/common/utils/day';
import MyShowAttachments from '@/components/ShowAttachments';
import { EmergencyEventsStatusEnum } 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>
        <ProDescriptions bordered title="基本信息" column={2}>
          <ProDescriptions.Item label="事件名称">
            {item?.name}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="项目名称">
            {item?.asset_project?.name}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="状态">
            <renderTextHelper.Tag
              Enums={EmergencyEventsStatusEnum}
              value={item?.status}
              key="type"
            />
          </ProDescriptions.Item>
          <ProDescriptions.Item label="事件等级">
            {item?.emergency_event_levels_name}
          </ProDescriptions.Item>

          <ProDescriptions.Item label="分类">
            {item?.one_emergency_categories_name}/
            {item?.two_emergency_categories_name}
          </ProDescriptions.Item>

          <ProDescriptions.Item label="发生时间">
            {showTime(item?.emergency_time, 10)}
          </ProDescriptions.Item>

          <ProDescriptions.Item label="组织">
            {item?.emergency_event_organization?.name}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="发生地址">
            {item?.emergency_location}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="突发事件描述">
            {item?.emergency_description}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="突发事件原因">
            {item?.emergency_cause}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="突发事件造成结果">
            {item?.cause_result}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="补充信息">
            {item?.supplement}
          </ProDescriptions.Item>
          <ProDescriptions.Item label="突发事件关联人物">
            {item?.related_person}
          </ProDescriptions.Item>
        </ProDescriptions>
      </ProCard>
      {/* <ProCard>
        <ProDescriptions bordered title="赔偿信息" column={2}>
          <ProDescriptions.Item label="赔偿方">
            <renderTextHelper.Tag
              Enums={EmergencyEventsCompensationTypeEnum}
              value={item?.compensation_type}
              key="compensation_type"
            />
          </ProDescriptions.Item>
          <ProDescriptions.Item label="赔偿比例">
            {item?.compensation_rate}%
          </ProDescriptions.Item>
          <ProDescriptions.Item label="赔偿金额">
            {item?.compensation_amount}元
          </ProDescriptions.Item>
          <ProDescriptions.Item label="已支付赔偿">
            {item?.compensation_paid_amount}元
          </ProDescriptions.Item>
        </ProDescriptions>
      </ProCard> */}
      <MyShowAttachments item={props?.item?.emergency_images || []} />
    </Space>
  );
}
