import React, { useState, useEffect } from 'react';
import { Modal, Space, Button } from 'antd';
import ParseForm from 'parseForm';
import styles from './index.less';
const PerviewPrase = props => {
  const { visible, onCancel, tablesSchema } = props;

  return (
    <div className={styles.PerviewParse}>
      <Modal
        title="预览"
        bodyStyle={{
          width: '100%',
          minHeight: '200px',
          height: '780px',
          overflow: 'hidden',
        }}
        width="1800px"
        style={{ marginTop: '-80px' }}
        destroyOnClose
        maskClosable={false}
        footer={
          <Space>
            <Button onClick={onCancel} type="primary">
              关闭
            </Button>
          </Space>
        }
        {...props}
        forceRender
        getContainer={false}
      >
        {visible && <ParseForm tablesSchema={tablesSchema} noButtons />}
      </Modal>
    </div>
  );
};
export default PerviewPrase;
