import React , { useState } from 'react' ; import { EuiButtonEmpty } from '@elastic/eui' ; import { QUERY_TESTER_TITLE } from './i18n' ; import { QueryTesterFlyout } from '.' ; export const QueryTesterButton = ( ) => { const [ isQueryTesterOpen , setIsQueryTesterOpen ] = useState ( false ) ; return ( < > < EuiButtonEmpty iconType = "beaker" size = "s" onClick = { ( ) => setIsQueryTesterOpen ( ! isQueryTesterOpen ) } > { QUERY_TESTER_TITLE } < /EuiButtonEmpty> { isQueryTesterOpen && < QueryTesterFlyout onClose = { ( ) => setIsQueryTesterOpen ( false ) } />} < />); } ;