import React , { FC } from 'react' ; import { EuiToolTip } from '@elastic/eui' ; import { i18n } from '@kbn/i18n' ; import { createCapabilityFailureMessage } from '../../../../lib/authorization' ; interface CreateAlertRuleActionProps { disabled : boolean ; } export const crateAlertRuleActionNameText = i18n . translate ( 'xpack.transform.transformList.createAlertRuleNameText' , { defaultMessage : 'Create alert rule' , } ) ; export const CreateAlertRuleActionName = ( { disabled } ) => { if ( disabled ) { return ( < EuiToolTip position = "top" content = { createCapabilityFailureMessage ( 'canCreateTransformAlerts' ) } > < > { crateAlertRuleActionNameText } < /> < /EuiToolTip>); } return < > { crateAlertRuleActionNameText } < />; } ;