import { useApmParams } from './use_apm_params' ; import { useFetcher } from './use_fetcher' ; import { useTimeRange } from './use_time_range' ; export function useFallbackToTransactionsFetcher ( { kuery } ) { const { query } = useApmParams ( '/*' ) ; const rangeFrom = 'rangeFrom' in query ? query . rangeFrom : undefined ; const rangeTo = 'rangeTo' in query ? query . rangeTo : undefined ; const { start , end } = useTimeRange ( { rangeFrom , rangeTo , optional : true } ) ; const { data = { fallbackToTransactions : false } } = useFetcher ( ( callApmApi ) => { return callApmApi ( { endpoint : 'GET /internal/apm/fallback_to_transactions' , params : { query : { kuery , start , end } , } , } ) ; } , [ kuery , start , end ] ) ; return data ; }