/*
 * @Author: 赵伟
 * @Date: 2024-04-19 14:42:51
 * @Description: UI 公共方法
 */
import themes from '@/styles/theme.less';
import { Modal, type ModalFuncProps } from 'antd';

// 自定义 Confirm 弹框
export function modalConfirm({ title, content, onOk, ...rest }: ModalFuncProps) {
  Modal.confirm({
    ...rest,
    title: (
      <div>
        <img
          src="/assets/images/delete-icon.png"
          style={{ width: '120px', marginBottom: '24px' }}
          alt=""
        />
        <div style={{ color: themes.textColor, fontSize: '16px' }}>{title}</div>
      </div>
    ),
    content: content && <div style={{ color: themes.textColor, fontSize: '15px' }}>{content}</div>,
    okText: '确认',
    cancelText: '取消',
    onOk: onOk,
  });
}
