UNPKG

@jbrowse/plugin-wiggle

Version:

JBrowse 2 wiggle adapters, tracks, etc.

22 lines (21 loc) 1.7 kB
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { readConfObject } from '@jbrowse/core/configuration'; import Dialog from '@jbrowse/core/ui/Dialog'; import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material'; const ConfirmDialog = ({ tracks, onClose, }) => { const [val, setVal] = useState(`MultiWiggle ${Date.now()}`); const allQuant = tracks.every(t => t.type === 'QuantitativeTrack'); return (_jsxs(Dialog, { open: true, onClose: () => { onClose(false); }, title: "Confirm multi-wiggle track create", children: [_jsxs(DialogContent, { children: [_jsxs(Typography, { children: [!allQuant ? 'Not every track looks like a QuantitativeTrack. This could have unexpected behavior, confirm if it looks ok.' : null, "Listing:"] }), _jsx("ul", { children: tracks.map(track => (_jsxs("li", { children: [readConfObject(track, 'name'), " - ", track.type] }, track.trackId))) }), _jsx(TextField, { value: val, onChange: event => { setVal(event.target.value); }, helperText: "Track name" }), _jsx(Typography, { children: "Confirm creation of track?" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: () => { onClose(false); }, color: "primary", children: "Cancel" }), _jsx(Button, { onClick: () => { onClose(true, { name: val }); }, color: "primary", variant: "contained", autoFocus: true, children: "Submit" })] })] })); }; export default ConfirmDialog;