import React from 'react' ; import { EuiFormRow , EuiSwitch , EuiSwitchEvent , EuiToolTip } from '@elastic/eui' ; import { i18n } from '@kbn/i18n' ; interface Props { applyForceRefresh : boolean ; setApplyForceRefresh : ( applyGlobalTime : boolean ) => void ; } export function ForceRefreshCheckbox ( { applyForceRefresh , setApplyForceRefresh } ) { const onChange = ( event ) => { setApplyForceRefresh ( event . target . checked ) ; } ; return ( < EuiFormRow display = "columnCompressedSwitch" > < EuiToolTip position = "top" content = { i18n . translate ( 'xpack.maps.filterEditor.applyForceRefreshTooltip' , { defaultMessage : `When enabled, layer re-fetches data when automatic refresh fires and when "Refresh" is clicked.` , } ) } > < EuiSwitch label = { i18n . translate ( 'xpack.maps.filterEditor.applyForceRefreshLabel' , { defaultMessage : `Apply global refresh to layer data` , } ) } checked = { applyForceRefresh } onChange = { onChange } data - test - subj = "mapLayerPanelRespondToForceRefreshCheckbox" compressed / > < /EuiToolTip> < /EuiFormRow>); }