import React from 'react'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; import { Dialog, DialogContent, Grid, Box, Theme, makeStyles, DialogActions, Button, useTheme } from '@material-ui/core'; import { ErrorOutline } from '@material-ui/icons'; import { cancelOrder, archiveDemand } from '../../features/orders/actions'; import { Order, Demand } from '../../utils/exchange'; interface IOwnProps { demand?: Demand; order?: Order; close: () => void; } export const RemoveOrderConfirmation = (props: IOwnProps) => { const { demand, order, close } = props; const { t } = useTranslation(); const useIconStyles = makeStyles((theme: Theme) => ({ large: { fontSize: theme.spacing(10) } })); const iconStyles = useIconStyles(); const dispatch = useDispatch(); const { spacing } = useTheme(); const onCancelOrder = () => { if (order) { dispatch(cancelOrder(order)); } else { dispatch(archiveDemand(demand)); } close(); }; return ( {t('order.feedback.removeOrderConfirmation')} ); };