import React , { FC } from 'react' ; import { i18n } from '@kbn/i18n' ; import { MlRoute , PageLoader , PageProps } from '../router' ; import { useResolver } from '../use_resolver' ; import { Page } from '../../access_denied' ; const breadcrumbs = [ { text : i18n . translate ( 'xpack.ml.accessDeniedLabel' , { defaultMessage : 'Access denied' , } ) , href : '' , } , ] ; export const accessDeniedRouteFactory = ( ) : MlRoute => ( { path : '/access-denied' , render : ( props , deps ) => < PageWrapper { ... props } deps = { deps } / > , breadcrumbs , } ) ; const PageWrapper = ( { deps } ) => { const { context } = useResolver ( undefined , undefined , deps . config , deps . dataViewsContract , { } ) ; return ( < PageLoader context = { context } > < Page /> < /PageLoader>); } ;