import React from 'react' ; import { EuiEmptyPrompt , EuiLoadingSpinner , EuiText , EuiFlexGroup , EuiFlexItem , EuiTextColor , } from '@elastic/eui' ; interface Props { inline ? : boolean ; children : React . ReactNode ; [ key ] : any ; } export const SectionLoading = ( { inline , children , ... rest } ) => { if ( inline ) { return ( < EuiFlexGroup justifyContent = "flexStart" alignItems = "center" gutterSize = "s" > < EuiFlexItem grow = { false } > < EuiLoadingSpinner size = "m" / > < /EuiFlexItem> < EuiFlexItem grow = { false } > < EuiText { ... rest } > < EuiTextColor color = "subdued" > { children } < /EuiTextColor> < /EuiText> < /EuiFlexItem> < /EuiFlexGroup>); } return ( < EuiEmptyPrompt title = { < EuiLoadingSpinner size = "xl" / > } body = { < EuiText color = "subdued" > { children } < /EuiText>} data-test-subj="sectionLoading"/ > ) ; } ;