import React from 'react' ; import { FormattedMessage } from '@kbn/i18n-react' ; import { EuiHealth } from '@elastic/eui' ; import { RepositoryVerification } from '../../../common/types' ; interface Props { verificationResults : RepositoryVerification | null ; } export const RepositoryVerificationBadge = ( { verificationResults , } ) => { if ( ! verificationResults ) { return ( < EuiHealth color = "subdued" > < FormattedMessage id = "xpack.snapshotRestore.repositoryVerification.verificationUnknownValue" defaultMessage = "Unknown" / > < /EuiHealth>); } if ( verificationResults . valid ) { return ( < EuiHealth color = "success" > < FormattedMessage id = "xpack.snapshotRestore.repositoryVerification.verificationSuccessfulValue" defaultMessage = "Connected" / > < /EuiHealth>); } return ( < EuiHealth color = "warning" > < FormattedMessage id = "xpack.snapshotRestore.repositoryVerification.verificationErrorValue" defaultMessage = "Not connected" / > < /EuiHealth>); } ;