import { MyBetaModalFormProps } from '@/common';

import ArchiveShow from '@/pages/contract/contract_archives/modals/Show';
import ArchiveBorrowShow from '@/pages/contract/contract_borrows/borrows/modals/Show';
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
import { useNavigate } from '@umijs/max';
import { Form, Space } from 'antd';

export default function Update(props: MyBetaModalFormProps) {
  const [form] = Form.useForm();
  const navigate = useNavigate();

  return (
    <>
      <Space direction="vertical" style={{ width: '100%' }}>
        <ProCard title="基本信息" size="small">
          <ProDescriptions size="small" column={2}>
            <ProDescriptions.Item label="档案id">
              {props?.item?.model?.contract_archives_id}
              <ArchiveShow
                item={{
                  id: props?.item?.model?.contract_archives_id,
                  type: 'link',
                }}
                title="查看档案"
              />
            </ProDescriptions.Item>
            <ProDescriptions.Item label="借阅人">
              {props?.item?.model?.borrower_name}
            </ProDescriptions.Item>
            <ProDescriptions.Item label="借阅日期">
              {props?.item?.model?.borrow_date}
            </ProDescriptions.Item>
            <ProDescriptions.Item label="是否需要归还">
              {props?.item?.model?.is_need_return ? '是' : '否'}
            </ProDescriptions.Item>
            <ProDescriptions.Item label="预计归还日期">
              {props?.item?.model?.expected_return_date}
            </ProDescriptions.Item>
            <ProDescriptions.Item label="申请说明" span={2}>
              {props?.item?.model?.remark}
            </ProDescriptions.Item>
            <ProDescriptions.Item label="借阅文件" span={2}>
              <ArchiveBorrowShow
                item={{
                  id: props?.item?.model?.id,
                  type: 'link',
                }}
                title="查看详情"
              />
            </ProDescriptions.Item>
          </ProDescriptions>
        </ProCard>
      </Space>
    </>
  );
}
