import React , { FC , useState } from 'react' ; import { EuiButtonEmpty } from '@elastic/eui' ; import { FormattedMessage } from '@kbn/i18n-react' ; import { useRefreshAnalyticsList } from '../../../../common' ; export const RefreshAnalyticsListButton = ( ) => { const [ isLoading , setIsLoading ] = useState ( false ) ; const { refresh } = useRefreshAnalyticsList ( { isLoading : setIsLoading } ) ; return ( < EuiButtonEmpty data - test - subj = { `mlAnalyticsRefreshListButton${ isLoading ? ' loading' : ' loaded' }` } onClick = { refresh } isLoading = { isLoading } > < FormattedMessage id = "xpack.ml.dataframe.analyticsList.refreshButtonLabel" defaultMessage = "Refresh" / > < /EuiButtonEmpty>); } ;