import React from 'react';
import { Button, Modal } from 'antd';
import { BpmDiagram, BpmTrace } from '../../../components/';

const modal =
  ({
     domain,
     record,
     onCancel,
     dispatch,
     loading,
     ...modalProps
   }) => {
    const handleCancel = () => {
      onCancel();
    };

    const modalOpts = {
      ...modalProps,
      onCancel: handleCancel,
      footer: <Button key="back" onClick={handleCancel}>取消</Button>,
    };

    return (
      <Modal {...modalOpts}>
        <BpmDiagram def={record.defId} instance={record.prcId} />
        <BpmTrace id={record.prcId} />
      </Modal>
    );
  };

export default modal;
