import React from 'react' ; import { EuiNotificationBadge , EuiFlexGroup , EuiFlexItem } from '@elastic/eui' ; import { useContainerState } from '../../../../../../../../src/plugins/kibana_utils/public' ; import { EnhancedEmbeddableContext } from '../../../../../../embeddable_enhanced/public' ; import { txtDisplayName } from './i18n' ; import { ActionExecutionContext } from '../../../../../../../../src/plugins/ui_actions/public' ; export const MenuItem = ( { context , } ) => { const { events } = useContainerState ( context . embeddable . enhancements . dynamicActions . state ) ; const count = events . length ; return ( < EuiFlexGroup alignItems = { 'center' } > < EuiFlexItem grow = { true } > { txtDisplayName } < /EuiFlexItem> { count > 0 && ( < EuiFlexItem grow = { false } > < EuiNotificationBadge > { count } < /EuiNotificationBadge> < /EuiFlexItem>)} < /EuiFlexGroup>); } ;