@jbrowse/core
Version:
JBrowse 2 core libraries used by plugins
25 lines (24 loc) • 1.45 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = FactoryResetDialog;
const jsx_runtime_1 = require("react/jsx-runtime");
const Dialog_1 = __importDefault(require("@jbrowse/core/ui/Dialog"));
const material_1 = require("@mui/material");
function FactoryResetDialog({ onClose, open, onFactoryReset, }) {
function handleDialogClose(action) {
if (action === 'reset') {
onFactoryReset();
}
onClose();
}
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { title: "Reset", onClose: () => {
handleDialogClose();
}, open: open, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: "Are you sure you want to reset? This will restore the default configuration." }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
handleDialogClose();
}, color: "primary", children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
handleDialogClose('reset');
}, color: "primary", variant: "contained", children: "OK" })] })] }));
}