import React , { Fragment } from 'react' ; import { FormattedMessage } from '@kbn/i18n-react' ; import { EuiCallOut , EuiSpacer } from '@elastic/eui' ; import { ThemeServiceStart , ToastInput } from 'src/core/public' ; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public' ; export const getGeneralErrorToast = ( errorText , err , theme ) : ToastInput => ( { text : toMountPoint ( < Fragment > < EuiCallOut title = { errorText } color = "danger" iconType = "alert" > { err . toString ( ) } < /EuiCallOut> < EuiSpacer / > < FormattedMessage id = "xpack.reporting.publicNotifier.error.tryRefresh" defaultMessage = "Try refreshing the page." / > < /Fragment>, { theme$: theme.theme$ }), iconType : undefined , } ) ;