import { ExclamationCircleOutlined } from '@ant-design/icons';
import { Modal } from 'antd';
import { ConfirmModal } from 'types/default';

const { confirm } = Modal;

export const showConfirmModal = (props: ConfirmModal): void => {
  confirm({
    title: props.title,
    icon: <ExclamationCircleOutlined />,
    okText: props.okText || 'Yes',
    okType: props.okType,
    cancelText: props.cancelText || 'Cancel',
    onOk() {
      props.action();
    },
    onCancel() {},
  });
};
