import { useRouter } from '@kbn/typed-react-router-config' ; import type { ApmRouter } from '../components/routing/apm_route_config' ; import { useApmPluginContext } from '../context/apm_plugin/use_apm_plugin_context' ; export function useApmRouter ( ) { const router = useRouter ( ) ; const { core } = useApmPluginContext ( ) ; const link = ( ... args ) => { return core . http . basePath . prepend ( '/app/apm' + router . link ( ... args ) ) ; } ; return { ... router , link , } as unknown as ApmRouter ; }