UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

30 lines (29 loc) 1.31 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { forwardRef } from 'react'; import { observer } from 'mobx-react'; import SequenceContents from "./SequenceContents.js"; import SequenceName from "./SequenceName.js"; function WordWrap({ children }) { return (_jsx("pre", { style: { fontFamily: 'monospace', color: 'black', fontSize: 11, }, children: children })); } function NoWordWrap({ children }) { return (_jsx("div", { style: { fontFamily: 'monospace', color: 'black', fontSize: 11, maxWidth: 600, whiteSpace: 'wrap', wordBreak: 'break-all', }, children: children })); } const SequencePanel = observer(forwardRef(function S(props, ref) { const { sequence, model, feature } = props; const { showCoordinates, mode } = model; const Container = showCoordinates ? WordWrap : NoWordWrap; return (_jsx("div", { "data-testid": "sequence_panel", ref: ref, style: { maxHeight: 300, overflow: 'auto' }, children: _jsxs(Container, { children: [_jsx(SequenceName, { model: model, mode: mode, feature: feature }), _jsx(SequenceContents, { model: model, mode: mode, feature: feature, sequence: sequence })] }) })); })); export default SequencePanel;