import type { Assign } from '@kbn/utility-types' ; import { omit } from 'lodash' ; import { useMemo , useContext } from 'react' ; import type { ApmUrlParams } from './types' ; import { UrlParamsContext } from './url_params_context' ; export function useLegacyUrlParams ( ) { const context = useContext ( UrlParamsContext ) ; return useMemo ( ( ) => { return { ... context , urlParams : omit ( context . urlParams , [ 'environment' , 'kuery' ] ) , } ; } , [ context ] ) ; }