import { useMemo } from 'react' ; import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context' ; import { useApmParams } from '../../../hooks/use_apm_params' ; import { useTimeRange } from '../../../hooks/use_time_range' ; export const useFetchParams = ( ) => { const { serviceName } = useApmServiceContext ( ) ; const { query : { kuery , environment , rangeFrom , rangeTo , transactionName , transactionType , } , } = useApmParams ( '/services/{serviceName}/transactions/view' ) ; const { start , end } = useTimeRange ( { rangeFrom , rangeTo } ) ; return useMemo ( ( ) => ( { serviceName , transactionName , transactionType , kuery , environment , start , end , } ) , [ serviceName , transactionName , transactionType , kuery , environment , start , end , ] ) ; } ;