/*
 * @Author: 赵伟
 * @Date: 2024-04-15 10:01:29
 * @Description: 自定义 Modal
 */

import ModalTitle from '@/components/ModalTitle';
import { Modal, type ModalProps } from 'antd';
import classNames from 'classnames';
import './index.less';

export interface KFModalProps extends ModalProps {
  image?: string;
}
function KFModal({
  title,
  image,
  children,
  className = '',
  centered,
  maskClosable,
  ...rest
}: KFModalProps) {
  return (
    <Modal
      className={classNames(['kf-modal', className])}
      {...rest}
      centered={centered ?? true}
      maskClosable={maskClosable ?? false}
      title={<ModalTitle title={title} image={image}></ModalTitle>}
    >
      {children}
    </Modal>
  );
}

export default KFModal;
