Skip to content

Commit

Permalink
Use SharedUX empty prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Nov 28, 2023
1 parent 6adeb1b commit 3195a3b
Showing 1 changed file with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

import * as React from 'react';

import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { EuiButtonEmpty } from '@elastic/eui';
import { HttpStart } from '@kbn/core/public';
import { i18n } from '@kbn/i18n';
import { NotFoundPrompt } from '@kbn/shared-ux-prompt-not-found';

const defaultTitle = i18n.translate('share.urlService.redirect.components.Error.title', {
defaultMessage: 'Unable to open URL',
Expand Down Expand Up @@ -39,24 +40,19 @@ export const RedirectEmptyPrompt: React.FC<ErrorProps> = ({
console.error('Short URL Redirect Error', props.error);

return (
<EuiEmptyPrompt
<NotFoundPrompt
title={<h2>{title}</h2>}
body={
<>
<p data-test-subj="redirectErrorEmptyPromptBody">{body}</p>
<p>
<EuiButton
iconType="refresh"
fill={true}
href={props.http.basePath.get()}
data-test-subj="redirectErrorEmptyPromptButton"
>
{i18n.translate('share.urlService.redirect.components.Error.homeButton', {
defaultMessage: 'Back to home',
})}
</EuiButton>
</p>
</>
body={<p data-test-subj="redirectErrorEmptyPromptBody">{body}</p>}
actions={
<EuiButtonEmpty
iconType="arrowLeft"
href={props.http.basePath.get()}
data-test-subj="redirectErrorEmptyPromptButton"
>
{i18n.translate('share.urlService.redirect.components.Error.homeButton', {
defaultMessage: 'Back to home',
})}
</EuiButtonEmpty>
}
/>
);
Expand Down

0 comments on commit 3195a3b

Please sign in to comment.