import { FormattedMessage } from '@kbn/i18n-react' ; import React , { Fragment } from 'react' ; import { ThemeServiceStart , ToastInput } from 'src/core/public' ; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public' ; import { JobId , JobSummary } from '../../common/types' ; import { DownloadButton } from './job_download_button' ; import { ReportLink } from './report_link' ; export const getSuccessToast = ( job , getReportLink , getDownloadLink , theme ) : ToastInput => ( { title : toMountPoint ( < FormattedMessage id = "xpack.reporting.publicNotifier.successfullyCreatedReportNotificationTitle" defaultMessage = "Created report for {reportObjectType} '{reportObjectTitle}'" values = { { reportObjectType : job . jobtype , reportObjectTitle : job . title } } / > , { theme$ : theme . theme$ } ) , color : 'success' , text : toMountPoint ( < Fragment > < p > < ReportLink getUrl = { getReportLink } / > < /p> < DownloadButton getUrl = { getDownloadLink } job = { job } / > < /Fragment>, { theme$: theme.theme$ }), 'data-test-subj' : 'completeReportSuccess' , } ) ;