UNPKG

@jbrowse/plugin-linear-genome-view

Version:

JBrowse 2 linear genome view

18 lines (17 loc) 1.15 kB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; import { Suspense, lazy, useState } from 'react'; import HelpIcon from '@mui/icons-material/Help'; import SearchIcon from '@mui/icons-material/Search'; import { IconButton, InputAdornment } from '@mui/material'; const HelpDialog = lazy(() => import('./HelpDialog')); function HelpAdornment() { const [isHelpDialogDisplayed, setHelpDialogDisplayed] = useState(false); return (_jsxs(_Fragment, { children: [_jsx(IconButton, { onClick: () => { setHelpDialogDisplayed(true); }, size: "small", children: _jsx(HelpIcon, { fontSize: "small" }) }), isHelpDialogDisplayed ? (_jsx(Suspense, { fallback: null, children: _jsx(HelpDialog, { handleClose: () => { setHelpDialogDisplayed(false); } }) })) : null] })); } export default function EndAdornment({ showHelp }) { return (_jsx(_Fragment, { children: _jsxs(InputAdornment, { position: "end", style: { marginRight: 7 }, children: [_jsx(SearchIcon, { fontSize: "small" }), showHelp ? _jsx(HelpAdornment, {}) : null] }) })); }