/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ import React, { Component } from 'react'; import { EuiModal, EuiModalBody, EuiModalHeader, EuiModalHeaderTitle, EuiOverlayMask, EuiCodeBlock, } from '@elastic/eui'; interface CodeModalProps { code: string; title: string; subtitle?: string; getModalVisibilityChange: () => boolean; closeModal: () => void; } export class CodeModal extends Component { constructor(props: CodeModalProps) { super(props); } render() { let modal; if (this.props.getModalVisibilityChange()) { modal = (

{this.props.title}

{this.props.subtitle ? (

{this.props.subtitle}

) : ( {} )}
{this.props.code}
); } return
{modal}
; } }