State colors follow the convention from @cameleer/design-system (CRITICAL->error, WARNING->warning, INFO->auto). Silenced pill stacks next to state for the spec section 8 audit-trail surface.
21 lines
553 B
TypeScript
21 lines
553 B
TypeScript
import { Badge } from '@cameleer/design-system';
|
|
import type { AlertDto } from '../api/queries/alerts';
|
|
|
|
type Severity = NonNullable<AlertDto['severity']>;
|
|
|
|
const LABELS: Record<Severity, string> = {
|
|
CRITICAL: 'Critical',
|
|
WARNING: 'Warning',
|
|
INFO: 'Info',
|
|
};
|
|
|
|
const COLORS: Record<Severity, 'auto' | 'warning' | 'error'> = {
|
|
CRITICAL: 'error',
|
|
WARNING: 'warning',
|
|
INFO: 'auto',
|
|
};
|
|
|
|
export function SeverityBadge({ severity }: { severity: Severity }) {
|
|
return <Badge label={LABELS[severity]} color={COLORS[severity]} variant="filled" />;
|
|
}
|