import { EuiModalBody , EuiModalHeader , EuiModalHeaderTitle } from '@elastic/eui' ; import { i18n } from '@kbn/i18n' ; import { FormattedMessage } from '@kbn/i18n-react' ; import React , { FC } from 'react' ; import { SavedObjectFinderUi } from '../../../../../../../../../src/plugins/saved_objects/public' ; import { useAppDependencies } from '../../../../app_dependencies' ; interface SearchSelectionProps { onSearchSelected : ( searchId : string , searchType : string ) => void ; } const fixedPageSize = 8 ; export const SearchSelection = ( { onSearchSelected } ) => { const { uiSettings , savedObjects } = useAppDependencies ( ) ; return ( < > < EuiModalHeader > < EuiModalHeaderTitle > < FormattedMessage id = "xpack.transform.newTransform.newTransformTitle" defaultMessage = "New transform" / > { ' ' } / { ' ' } < FormattedMessage id = "xpack.transform.newTransform.chooseSourceTitle" defaultMessage = "Choose a source" / > < /EuiModalHeaderTitle> < /EuiModalHeader> < EuiModalBody > < SavedObjectFinderUi key = "searchSavedObjectFinder" onChoose = { onSearchSelected } showFilter noItemsMessage = { i18n . translate ( 'xpack.transform.newTransform.searchSelection.notFoundLabel' , { defaultMessage : 'No matching indices or saved searches found.' , } ) } savedObjectMetaData = { [ { type : 'search' , getIconForSavedObject : ( ) => 'search' , name : i18n . translate ( 'xpack.transform.newTransform.searchSelection.savedObjectType.search' , { defaultMessage : 'Saved search' , } ) , } , { type : 'index-pattern' , getIconForSavedObject : ( ) => 'indexPatternApp' , name : i18n . translate ( 'xpack.transform.newTransform.searchSelection.savedObjectType.dataView' , { defaultMessage : 'Data view' , } ) , } , ] } fixedPageSize = { fixedPageSize } uiSettings = { uiSettings } savedObjects = { savedObjects } / > < /EuiModalBody> < />); } ;