import { EuiBadge } from '@elastic/eui' ; import React from 'react' ; export interface SeverityBadgeProps { severityLevel ? : string ; } const colorMap = { critical : 'danger' , warning : 'warning' , } ; export function SeverityBadge ( { severityLevel } ) { if ( ! severityLevel ) { return null ; } return ( < EuiBadge color = { severityLevel ? colorMap [ severityLevel ] : 'default' } > { severityLevel } < /EuiBadge>); }