import React from 'react' ; import ReactDOM from 'react-dom' ; import 'react-vis/dist/style.css' ; import type { ObservabilityRuleTypeRegistry } from '../../../observability/public' ; import { ConfigSchema } from '../' ; import { AppMountParameters , CoreStart , APP_WRAPPER_CLASS , } from '../../../../../src/core/public' ; import { ApmPluginSetupDeps , ApmPluginStartDeps } from '../plugin' ; import { createCallApmApi } from '../services/rest/createCallApmApi' ; import { createStaticDataView } from '../services/rest/data_view' ; import { setHelpExtension } from '../setHelpExtension' ; import { setReadonlyBadge } from '../updateBadge' ; import { ApmAppRoot } from '../components/routing/app_root' ; /**
 * This module is rendered asynchronously in the Kibana platform.
 */ export const renderApp = ( { coreStart , pluginsSetup , appMountParameters , config , pluginsStart , observabilityRuleTypeRegistry , } ) => { const { element } = appMountParameters ; const apmPluginContextValue = { appMountParameters , config , core : coreStart , plugins : pluginsSetup , data : pluginsStart . data , inspector : pluginsStart . inspector , observability : pluginsStart . observability , observabilityRuleTypeRegistry , } ; setHelpExtension ( coreStart ) ; setReadonlyBadge ( coreStart ) ; createCallApmApi ( coreStart ) ; createStaticDataView ( ) . catch ( ( e ) => { console . log ( 'Error creating static data view' , e ) ; } ) ; element . classList . add ( APP_WRAPPER_CLASS ) ; ReactDOM . render ( < ApmAppRoot apmPluginContextValue = { apmPluginContextValue } pluginsStart = { pluginsStart } / > , element ) ; return ( ) => { ReactDOM . unmountComponentAtNode ( element ) ; } ; } ;