import React from 'react' ; import { useActions } from 'kea' ; import { EuiButton } from '@elastic/eui' ; import { i18n } from '@kbn/i18n' ; import { DocumentCreationLogic , DocumentCreationFlyout } from '../../document_creation' ; export const DocumentCreationButton = ( ) => { const { showCreationModes } = useActions ( DocumentCreationLogic ) ; return ( < > < EuiButton fill iconType = "plusInCircle" data - test - subj = "IndexDocumentsButton" onClick = { showCreationModes } > { i18n . translate ( 'xpack.enterpriseSearch.appSearch.documents.indexDocuments' , { defaultMessage : 'Index documents' , } ) } < /EuiButton> < DocumentCreationFlyout / > < />); } ;