import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Suspense } from 'react';
import { readConfObject } from '@jbrowse/core/configuration';
import { LoadingEllipses, createJBrowseTheme } from '@jbrowse/core/ui';
import { EmbeddedViewContainer, ModalWidget } from '@jbrowse/embedded-core';
import { getEnv } from '@jbrowse/mobx-state-tree';
import { ThemeProvider } from '@mui/material';
import { observer } from 'mobx-react';
const JBrowseLinearGenomeView = observer(function JBrowseLinearGenomeView({ viewState, }) {
    const { session } = viewState;
    const { view } = session;
    const { pluginManager } = getEnv(session);
    const { ReactComponent } = pluginManager.getViewType(view.type);
    const theme = createJBrowseTheme(readConfObject(viewState.config.configuration, 'theme'));
    return (_jsxs(ThemeProvider, { theme: theme, children: [_jsx(EmbeddedViewContainer, { view: view, children: _jsx(Suspense, { fallback: _jsx(LoadingEllipses, {}), children: _jsx(ReactComponent, { model: view, session: session }) }) }, `view-${view.id}`), _jsx(ModalWidget, { session: session })] }));
});
export default JBrowseLinearGenomeView;
