import React, { useState } from 'react';
import i18n from 'ui-i18n';
import { pipe } from 'ramda';
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 Radio from '@mui/material/Radio';
import RadioGroup from '@mui/material/RadioGroup';
import FormControlLabel from '@mui/material/FormControlLabel';
import FormControl from '@mui/material/FormControl';
import FormLabel from '@mui/material/FormLabel';
import { getValue } from '../../../../../helpers/events';
export var ConfirmEditIgnoredDialog = function (_a) {
    var open = _a.open, onClose = _a.onClose, onConfirmEditWithoutIgnore = _a.onConfirmEditWithoutIgnore, onConfirmEditWithIgnore = _a.onConfirmEditWithIgnore;
    var _b = useState('without'), option = _b[0], setOption = _b[1];
    return (React.createElement(Dialog, { open: open, TransitionProps: {
            onEnter: function () { return setOption('without'); }
        } },
        React.createElement(DialogContent, null,
            React.createElement(DialogContentText, null, i18n.text('You are attempting to change a value that is presently ignored.')),
            React.createElement(FormControl, { variant: "standard", component: "fieldset" },
                React.createElement(FormLabel, { component: "legend" }, i18n.text('Please choose an option:')),
                React.createElement(RadioGroup, { value: option, onChange: pipe(getValue, setOption) },
                    React.createElement(FormControlLabel, { value: "without", control: React.createElement(Radio, null), label: i18n.text('Save without Ignore') }),
                    React.createElement(FormControlLabel, { value: "with", control: React.createElement(Radio, null), label: i18n.text('Save and apply Ignore to new value') })))),
        React.createElement(DialogActions, null,
            React.createElement(Button, { onClick: onClose, color: "primary" }, i18n.text('Cancel')),
            React.createElement(Button, { onClick: function () {
                    if (option === 'with') {
                        onConfirmEditWithIgnore();
                    }
                    else {
                        onConfirmEditWithoutIgnore();
                    }
                    onClose();
                }, color: "primary" }, i18n.text('Ok')))));
};
