import React from 'react'; import Button from '@material-ui/core/Button'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; import DialogContentText from '@material-ui/core/DialogContentText'; import t from './LocalizationProvider'; const RemoveDialog = ({ open, endpoint, itemId, onResult, }) => { const handleRemove = async () => { const response = await fetch(`/api/${endpoint}/${itemId}`, { method: 'DELETE' }); if (response.ok) { onResult(true); } }; return ( { onResult(false); }} > {t('sharedRemoveConfirm')} ); }; export default RemoveDialog;