import React from 'react' ; import ReactDOM from 'react-dom' ; import { KibanaThemeProvider } from '../../../kibana_react/public' ; import { Embeddable , EmbeddableOutput } from '../../../../plugins/embeddable/public' ; import { DisabledLabVisualization } from './disabled_lab_visualization' ; import { VisualizeInput } from './visualize_embeddable' ; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants' ; import { getTheme } from '../services' ; export class DisabledLabEmbeddable extends Embeddable < VisualizeInput , EmbeddableOutput > { private domNode ? : HTMLElement ; public readonly type = VISUALIZE_EMBEDDABLE_TYPE ; constructor ( private readonly title , initialInput ) { super ( initialInput , { title } ) ; } public reload ( ) { } public render ( domNode ) { if ( this . title ) { this . domNode = domNode ; ReactDOM . render ( < KibanaThemeProvider theme$ = { getTheme ( ) . theme$ } > < DisabledLabVisualization title = { this . title } / > < /KibanaThemeProvider>, domNode); } } public destroy ( ) { if ( this . domNode ) { ReactDOM . unmountComponentAtNode ( this . domNode ) ; } } }