import { CoreStart } from 'src/core/public' ; import React from 'react' ; import { KibanaReactOverlays } from 'src/plugins/kibana_react/public' ; import { SourceModal } from '../components/source_modal' ; import { IndexPatternSavedObject } from '../types' ; export function openSourceModal ( { overlays , savedObjects , uiSettings , } , onSelected ) { const modalRef = overlays . openModal ( < SourceModal uiSettings = { uiSettings } savedObjects = { savedObjects } onIndexPatternSelected = { ( indexPattern ) => { onSelected ( indexPattern ) ; modalRef . close ( ) ; } } />); }