import React from 'react' ; import { i18n } from '@kbn/i18n' ; import { EuiCallOut } from '@elastic/eui' ; import { toMountPoint , wrapWithTheme } from '../../../../../../src/plugins/kibana_react/public' ; import { getOverlays , getTheme } from '../util/dependency_cache' ; let expiredLicenseBannerId ; export function showExpiredLicenseWarning ( ) { if ( expiredLicenseBannerId === undefined ) { const message = i18n . translate ( 'xpack.ml.checkLicense.licenseHasExpiredMessage' , { defaultMessage : 'Your Machine Learning license has expired.' , } ) ; const overlays = getOverlays ( ) ; const theme = getTheme ( ) ; expiredLicenseBannerId = overlays . banners . add ( toMountPoint ( wrapWithTheme ( < EuiCallOut iconType = "iInCircle" color = "warning" title = { message } / > , theme . theme$ ) ) ) ; } }