import React from 'react'; import { Button } from 'antd'; import styled from 'styled-components'; import { useDispatch } from 'react-redux'; import Modal from '../components/Modal'; import { closeModal } from '../reducers/modals/actions'; const Container = styled.div` display: flex; flex-direction: column; width: 100%; height: 100%; text-align: center; justify-content: space-between; `; const Buttons = styled.div` display: flex; flex-direction: row; width: 100%; justify-content: space-between; `; const applyChoice = async ( choiceType, callback, fileName, dispatch, delay = 500 ) => { if (choiceType === 'abort') { if (callback) { callback(); setTimeout(() => dispatch(closeModal()), delay); } else dispatch(closeModal()); } else { callback(fileName); setTimeout(() => dispatch(closeModal()), delay); } }; export default function ActionConfirmation({ confirmCallback, abortCallback = () => {}, message, fileName, delay, title }) { const dispatch = useDispatch(); return ( {message} ); }