import {CircleExclamationFill, CircleXmarkFill, TriangleExclamationFill} from '@gravity-ui/icons'; import type {IconData, LabelProps} from '@gravity-ui/uikit'; import {Flex, Icon, Label, Text} from '@gravity-ui/uikit'; import {b} from '../constants'; import i18n from '../i18n'; interface StatusPairLegendProps { className?: string; label: string; } interface StatusPairLegendItem { text: string; theme: LabelProps['theme']; icon?: IconData; className?: string; } const iconSize = 12; const legendItems: StatusPairLegendItem[] = [ {text: i18n('compaction_ok'), theme: 'success'}, {text: i18n('compaction_notice'), theme: 'warning', icon: TriangleExclamationFill}, {text: i18n('compaction_warning'), theme: 'danger', icon: CircleExclamationFill}, { text: i18n('compaction_impaired'), theme: 'danger', icon: CircleXmarkFill, className: b('label-danger-heavy'), }, ]; export function StatusPairLegend({className, label}: StatusPairLegendProps) { return ( {label} {legendItems.map(({text, theme, icon, className: labelClassName}) => ( ))} {i18n('context_no-statistics')} ); }