import { i18n } from '@kbn/i18n' ; import { ExplorerState } from './state' ; export const setKqlQueryBarPlaceholder = ( state ) => { const { influencers , noInfluencersConfigured } = state ; if ( influencers !== undefined && ! noInfluencersConfigured ) { for ( const influencerName in influencers ) { if ( influencers [ influencerName ] [ 0 ] && influencers [ influencerName ] [ 0 ] . influencerFieldValue ) { return { filterPlaceHolder : i18n . translate ( 'xpack.ml.explorer.kueryBar.filterPlaceholder' , { defaultMessage : 'Filter by influencer fields… ({queryExample})' , values : { queryExample : `${ influencerName } : ${ influencers [ influencerName ] [ 0 ] . influencerFieldValue }` , } , } ) , } ; } } } return { } ; } ;