xmr-btc-swap/src/renderer/components/modal/SwapSuspendAlert.tsx
2024-07-06 21:34:33 +02:00

44 lines
1,000 B
TypeScript

import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
} from '@material-ui/core';
import IpcInvokeButton from '../IpcInvokeButton';
type SwapCancelAlertProps = {
open: boolean;
onClose: () => void;
};
export default function SwapSuspendAlert({
open,
onClose,
}: SwapCancelAlertProps) {
return (
<Dialog open={open} onClose={onClose}>
<DialogTitle>Force stop running operation?</DialogTitle>
<DialogContent>
<DialogContentText>
Are you sure you want to force stop the running swap?
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={onClose} color="primary">
No
</Button>
<IpcInvokeButton
ipcChannel="suspend-current-swap"
ipcArgs={[]}
color="primary"
onSuccess={onClose}
requiresRpc
>
Force stop
</IpcInvokeButton>
</DialogActions>
</Dialog>
);
}