import React from 'react';
import { Modal, ModalProps } from 'antd';

import { ProButton } from '@/components';

export interface ProModalProp extends ModalProps {}

const ProModal: React.FC<ProModalProp> = function ({ ...props }) {
  return (
    <Modal {...props} footer={null}>
      {/* content */}
      {props.children}

      {/* footer */}
      <div className="pt-6 pb-2 flex flex-row-reverse gap-x-4">
        <ProButton type="primary" onClick={props.onOk}>
          {props.cancelText || '确定'}
        </ProButton>
        <ProButton type="primary" proType="subPrimary" onClick={props.onCancel}>
          {props.okText || '取消'}
        </ProButton>
      </div>
    </Modal>
  );
};

export default ProModal;
