import { EuiLink } from '@elastic/eui' ; import React from 'react' ; import { APMLinkExtendProps , useAPMHref } from './apm_link' ; interface ServiceProfilingLinkProps extends APMLinkExtendProps { serviceName : string ; environment ? : string ; } export function useServiceProfilingHref ( { serviceName , environment , } ) { const query = environment ? { environment , } : { } ; return useAPMHref ( { path : `/services/${ serviceName }/profiling` , query , } ) ; } export function ServiceProfilingLink ( { serviceName , environment , ... rest } ) { const href = useServiceProfilingHref ( { serviceName , environment } ) ; return < EuiLink href = { href } { ... rest } />; }