@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
27 lines (26 loc) • 2.19 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const configuration_1 = require("@jbrowse/core/configuration");
const Dialog_1 = __importDefault(require("@jbrowse/core/ui/Dialog"));
const material_1 = require("@mui/material");
const ConfirmDialog = ({ tracks, onClose, }) => {
const [val, setVal] = (0, react_1.useState)(() => `MultiWiggle ${Date.now()}`);
const allQuant = tracks.every(t => t.type === 'QuantitativeTrack');
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: true, onClose: () => {
onClose(false);
}, title: "Confirm multi-wiggle track create", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { children: [!allQuant
? 'Not every track looks like a QuantitativeTrack. This could have unexpected behavior, confirm if it looks ok.'
: null, "Listing:"] }), (0, jsx_runtime_1.jsx)("ul", { children: tracks.map(track => ((0, jsx_runtime_1.jsxs)("li", { children: [(0, configuration_1.readConfObject)(track, 'name'), " - ", track.type] }, track.trackId))) }), (0, jsx_runtime_1.jsx)(material_1.TextField, { value: val, onChange: event => {
setVal(event.target.value);
}, helperText: "Track name" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Confirm creation of track?" })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
onClose(false);
}, color: "primary", children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
onClose(true, { name: val });
}, color: "primary", variant: "contained", autoFocus: true, children: "Submit" })] })] }));
};
exports.default = ConfirmDialog;