import * as Sentry from '@sentry/react'; import Tag from 'sentry/components/tag'; import {t} from 'sentry/locale'; import {CandidateDownloadStatus} from 'sentry/types/debugImage'; type Props = { status: CandidateDownloadStatus; }; function Status({status}: Props) { switch (status) { case CandidateDownloadStatus.OK: { return {t('Ok')}; } case CandidateDownloadStatus.ERROR: case CandidateDownloadStatus.MALFORMED: { return {t('Failed')}; } case CandidateDownloadStatus.NOT_FOUND: { return {t('Not Found')}; } case CandidateDownloadStatus.NO_PERMISSION: { return {t('Permissions')}; } case CandidateDownloadStatus.DELETED: { return {t('Deleted')}; } case CandidateDownloadStatus.UNAPPLIED: { return {t('Unapplied')}; } default: { Sentry.withScope(scope => { scope.setLevel('warning'); Sentry.captureException(new Error('Unknown image candidate download status')); }); return {t('Unknown')}; // This shall not happen } } } export default Status;