import qs from 'query-string' ; import React from 'react' ; import { Redirect } from 'react-router-dom' ; import { useApmParams } from '../../../hooks/use_apm_params' ; export function RedirectToBackendOverviewRouteView ( ) { const { path : { backendName } , query , } = useApmParams ( '/backends/{backendName}/overview' ) ; const search = qs . stringify ( { ... query , backendName } ) ; return < Redirect to = { { pathname : `/backends/overview` , search } } />; }