import React from 'react' ; import { I18nStart } from 'opensearch-dashboards/public' ; import { DataPublicPluginStart } from 'src/plugins/data/public' ; import { TopNavMenuProps , TopNavMenu } from './top_nav_menu' ; import { RegisteredTopNavMenuData } from './top_nav_menu_data' ; export function createTopNav ( data , extraConfig , i18n ) { return ( props ) => { const relevantConfig = extraConfig . filter ( ( dataItem ) => dataItem . appName === undefined || dataItem . appName === props . appName ) ; const config = ( props . config || [ ] ) . concat ( relevantConfig ) ; return ( < i18n . Context > < TopNavMenu { ... props } data = { data } config = { config } / > < /i18n.Context>); } ; }