import React from 'react'
import { Modal, Form } from 'antd'
import { formItemLayout } from '../../utils'

const noop = () => undefined

export default (props) => {
  const { title, visible, onCancel = noop, modalProps = {}, children, footer=null,...leftProps } = props

  return (
    <Modal
      title={title}
      width={800}
      visible={visible}
      onCancel={onCancel}
      footer={footer}
      {...modalProps}
    >
      <Form {...formItemLayout} {...leftProps} >
        {children}
      </Form>
    </Modal>
  )
}
