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