import React from 'react' ; import { pickKeys } from '../../../../../common/utils/pick_keys' ; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params' ; import { APMQueryParams } from '../url_helpers' ; import { APMLink , APMLinkExtendProps } from './apm_link' ; const persistedFilters = [ 'host' , 'containerId' , 'podName' , 'serviceVersion' , ] ; interface Props extends APMLinkExtendProps { serviceName : string ; query ? : APMQueryParams ; } export function ErrorOverviewLink ( { serviceName , query , ... rest } ) { const { urlParams } = useLegacyUrlParams ( ) ; return ( < APMLink path = { `/services/${ serviceName }/errors` } query = { { ... pickKeys ( urlParams as APMQueryParams , ... persistedFilters ) , ... query , } } { ... rest } />); }