import { FC } from 'react';
import { Modal } from 'antd';
import ButtonComp from '../ButtonComp';

interface PageProps {
  title?: string;
  visibility: boolean;
  onCancel: () => void;
  onOk: () => void;
  children?: any; // 插槽内容
}

const ClearInfoDialog: FC<PageProps> = ({
  title = "提示",
  visibility = false,
  onCancel,
  onOk,
  ...props
}) => {

  return (
    <Modal
      title={title}
      open={visibility}
      centered
      width={420}
      onCancel={onCancel}
      footer={null}
      maskClosable={false}
    >
      {props?.children}
      <div className='flex_jE mt20'>
        <ButtonComp style={{ marginRight: 20 }} text={'确定'} onClick={onOk} />
        <ButtonComp type="cancel" text={'取消'} onClick={onCancel} />
      </div>
    </Modal>
  )
}

export default ClearInfoDialog