import React , { FC } from 'react' ; import { i18n } from '@kbn/i18n' ; import { NavigateToPath , useTimefilter } from '../../../contexts/kibana' ; import { MlRoute , PageLoader , PageProps } from '../../router' ; import { useResolver } from '../../use_resolver' ; import { basicResolvers } from '../../resolvers' ; import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs' ; import { Page } from '../../../trained_models' ; export const nodesListRouteFactory = ( navigateToPath , basePath ) : MlRoute => ( { path : '/trained_models/nodes' , render : ( props , deps ) => < PageWrapper { ... props } deps = { deps } / > , breadcrumbs : [ getBreadcrumbWithUrlForApp ( 'ML_BREADCRUMB' , navigateToPath , basePath ) , getBreadcrumbWithUrlForApp ( 'TRAINED_MODELS' , navigateToPath , basePath ) , { text : i18n . translate ( 'xpack.ml.trainedModelsBreadcrumbs.nodesListLabel' , { defaultMessage : 'Nodes Overview' , } ) , href : '' , } , ] , enableDatePicker : true , } ) ; const PageWrapper = ( { location , deps } ) => { const { context } = useResolver ( undefined , undefined , deps . config , deps . dataViewsContract , basicResolvers ( deps ) ) ; useTimefilter ( { timeRangeSelector : false , autoRefreshSelector : true } ) ; return ( < PageLoader context = { context } > < Page /> < /PageLoader>); } ;