import React from 'react' ; import { useValues } from 'kea' ; import { EuiEmptyPrompt , EuiFlexGroup , EuiFlexItem , EuiButton } from '@elastic/eui' ; import { i18n } from '@kbn/i18n' ; import { LICENSED_SUPPORT_URL } from '../../../../common/constants' ; import { LicensingLogic } from '../licensing' ; import { EuiButtonTo } from '../react_router_helpers' ; interface Props { productSupportUrl : string ; backToLink ? : string ; } export const NotFoundPrompt = ( { productSupportUrl , backToLink = '/' } ) => { const { hasGoldLicense } = useValues ( LicensingLogic ) ; const supportUrl = hasGoldLicense ? LICENSED_SUPPORT_URL : productSupportUrl ; return ( < EuiEmptyPrompt iconType = "logoEnterpriseSearch" title = { < h1 > { i18n . translate ( 'xpack.enterpriseSearch.notFound.title' , { defaultMessage : '404 error' , } ) } < /h1>} body={<p> { i18n . translate ( 'xpack.enterpriseSearch.notFound.description' , { defaultMessage : 'The page you’re looking for was not found.' , } ) } < /p>} actions={<EuiFlexGroup> < EuiFlexItem > < EuiButtonTo to = { backToLink } fill > { i18n . translate ( 'xpack.enterpriseSearch.notFound.action1' , { defaultMessage : 'Back to your dashboard' , } ) } < /EuiButtonTo> < /EuiFlexItem> < EuiFlexItem > < EuiButton href = { supportUrl } target = "_blank" > { i18n . translate ( 'xpack.enterpriseSearch.notFound.action2' , { defaultMessage : 'Contact support' , } ) } < /EuiButton> < /EuiFlexItem> < /EuiFlexGroup>}/ > ) ; } ;