import * as React from 'react';
import { Modal, Button } from 'tea-component';
import classNames from '../../utils/classnames';

export default function WeDaModal(_props) {
  const {
    className,
    content,
    visible,
    customButton,
    customContent,
    isDefaultButton,
    emit,
    ...props
  } = _props;

  return (
    <Modal
      className={classNames('weda-ui', 'lcap-modal', 'container', className)}
      visible={visible}
      onClose={() => {
        emit('close');
      }}
      {...props}
    >
      <Modal.Body>{content ? content : customContent}</Modal.Body>
      <Modal.Footer>
        {isDefaultButton ? (
          <Button
            type="primary"
            onClick={() => {
              emit('confirm');
              // events.confirm();
            }}
          >
            确定
          </Button>
        ) : (
          customButton
        )}
      </Modal.Footer>
    </Modal>
  );
}
