import React from 'react';
import i18n from 'ui-i18n';
import Button from '@mui/material/Button';
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import { useStyles } from './styles';
export var ConfirmationDialog = function (_a) {
    var open = _a.open, title = _a.title, content = _a.content, onCancel = _a.onCancel, _b = _a.cancelCaption, cancelCaption = _b === void 0 ? i18n.text('Cancel') : _b, onDiscard = _a.onDiscard, _c = _a.discardCaption, discardCaption = _c === void 0 ? '' : _c, onSave = _a.onSave, _d = _a.saveCaption, saveCaption = _d === void 0 ? i18n.text('Save') : _d, _e = _a.disabledSave, disabledSave = _e === void 0 ? false : _e;
    var styles = useStyles();
    return (React.createElement(Dialog, { open: open, onClose: onCancel, classes: { paperScrollPaper: styles.paper } },
        React.createElement(DialogTitle, { classes: { root: styles.title } }, title),
        React.createElement(DialogContent, { classes: { root: styles.content } },
            React.createElement(DialogContentText, { classes: { root: styles.contentText } }, content)),
        React.createElement(DialogActions, { className: styles.actionButtons, disableSpacing: true },
            onCancel && React.createElement(Button, { onClick: onCancel }, cancelCaption),
            React.createElement("div", null,
                onDiscard && (React.createElement(Button, { onClick: onDiscard, classes: { root: styles.discardButton } }, discardCaption)),
                React.createElement(Button, { onClick: onSave, color: "primary", disabled: disabledSave, autoFocus: true }, saveCaption)))));
};
