import React from 'react' ; import { AgentConfigurationPageStep } from '../../../../common/agent_configuration/constants' ; import { useApmParams } from '../../../hooks/use_apm_params' ; import { useFetcher } from '../../../hooks/use_fetcher' ; import { AgentConfigurationCreateEdit } from '../../app/Settings/agent_configurations/AgentConfigurationCreateEdit' ; export function EditAgentConfigurationRouteView ( ) { const { query : { name , environment , pageStep = AgentConfigurationPageStep . ChooseSettings , } , } = useApmParams ( '/settings/agent-configuration/edit' ) ; const res = useFetcher ( ( callApmApi ) => { return callApmApi ( { endpoint : 'GET /api/apm/settings/agent-configuration/view' , params : { query : { name , environment } } , } ) ; } , [ name , environment ] ) ; return ( < AgentConfigurationCreateEdit pageStep = { pageStep } existingConfigResult = { res } / > ) ; }