import React from 'react' ; import { CoreStart } from 'src/core/public' ; import { toMountPoint } from '../../../../../plugins/opensearch_dashboards_react/public' ; import { ReplacePanelFlyout } from './replace_panel_flyout' ; import { IEmbeddable , EmbeddableInput , EmbeddableOutput , EmbeddableStart , IContainer , } from '../../embeddable_plugin' ; export async function openReplacePanelFlyout ( options ) { const { embeddable , core , panelToRemove , savedObjectFinder , notifications , getEmbeddableFactories , } = options ; const flyoutSession = core . overlays . openFlyout ( toMountPoint ( < ReplacePanelFlyout container = { embeddable } onClose = { ( ) => { if ( flyoutSession ) { flyoutSession . close ( ) ; } } } panelToRemove = { panelToRemove } savedObjectsFinder = { savedObjectFinder } notifications = { notifications } getEmbeddableFactories = { getEmbeddableFactories } / > ) , { 'data-test-subj' : 'dashboardReplacePanel' , ownFocus : true , } ) ; }