import React , { useCallback } from 'react' ; import { FieldHook } from '../../shared_imports' ; import { AgentsTable } from '../../agents/agents_table' ; import { AgentSelection } from '../../agents/types' ; interface AgentsTableFieldProps { field : FieldHook < AgentSelection > ; } const AgentsTableFieldComponent = ( { field } ) => { const { value , setValue } = field ; const handleChange = useCallback ( ( props ) => { if ( props !== value ) { return setValue ( props ) ; } } , [ value , setValue ] ) ; return < AgentsTable agentSelection = { value } onChange = { handleChange } / > ; } ; export const AgentsTableField = React . memo ( AgentsTableFieldComponent ) ;