@jbrowse/core
Version:
JBrowse 2 core libraries used by plugins
18 lines (17 loc) • 773 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { TextField } from '@mui/material';
import { observer } from 'mobx-react';
import { isUriLocation } from "../../util/types/index.js";
const UrlChooser = observer(function UrlChooser({ location, label, style, setLocation, }) {
return (_jsx(TextField, { variant: "outlined", fullWidth: true, defaultValue: location && isUriLocation(location) ? location.uri : '', label: label || 'Enter URL', style: style, onChange: event => {
setLocation({
uri: event.target.value.trim(),
locationType: 'UriLocation',
});
}, slotProps: {
htmlInput: {
'data-testid': 'urlInput',
},
} }));
});
export default UrlChooser;