import { useDispatch, useSelector } from 'react-redux' import axios from 'axios' import { CONFIRMATION_MODAL_CLOSE_TYPES } from '../../../../../../public/utils/globalConstantUtil' import { deleteLead } from '../../leads/leadSlice' import { showNotification } from '../headerSlice' function ConfirmationModalBody({ extraObject, closeModal }) { const dispatch = useDispatch() const { message, type, _id, index } = extraObject const proceedWithYes = async () => { if (type === CONFIRMATION_MODAL_CLOSE_TYPES.LEAD_DELETE) { // positive response, call api or dispatch redux function dispatch(deleteLead({ index })) dispatch(showNotification({ message: "Lead Deleted!", status: 1 })) } closeModal() } return ( <>
{message}