diff --git a/x-pack/plugins/infra/public/alerting/common/components/alert_preview.tsx b/x-pack/plugins/infra/public/alerting/common/components/alert_preview.tsx index 0e0e23ef73a3a..f3136ca155c78 100644 --- a/x-pack/plugins/infra/public/alerting/common/components/alert_preview.tsx +++ b/x-pack/plugins/infra/public/alerting/common/components/alert_preview.tsx @@ -14,13 +14,9 @@ import { EuiFlexGroup, EuiFlexItem, EuiCallOut, - EuiOverlayMask, - EuiModal, - EuiModalHeader, - EuiModalHeaderTitle, - EuiModalBody, + EuiAccordion, EuiCodeBlock, - EuiLink, + EuiText, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; @@ -61,9 +57,6 @@ export const AlertPreview: React.FC = (props) => { const [previewResult, setPreviewResult] = useState< (AlertPreviewSuccessResponsePayload & Record) | null >(null); - const [isErrorModalVisible, setIsErrorModalVisible] = useState(false); - const onOpenModal = useCallback(() => setIsErrorModalVisible(true), [setIsErrorModalVisible]); - const onCloseModal = useCallback(() => setIsErrorModalVisible(false), [setIsErrorModalVisible]); const onSelectPreviewLookbackInterval = useCallback((e) => { setPreviewLookbackInterval(e.target.value); @@ -271,33 +264,32 @@ export const AlertPreview: React.FC = (props) => { iconType="alert" > {previewError.body && ( - view the error, - }} - /> + <> + + + + + + + + } + > + + {previewError.body.message} + + )} )} - {isErrorModalVisible && ( - - - - - - - - - {previewError.body.message} - - - - )} )}