Files
Pulse/frontend-modern/src/utils/thresholdSliderPresentation.ts
2026-03-18 16:06:30 +00:00

24 lines
741 B
TypeScript

export type ThresholdSliderMetricType = 'cpu' | 'memory' | 'disk' | 'temperature';
const THRESHOLD_SLIDER_TEXT_CLASSES: Record<ThresholdSliderMetricType, string> = {
cpu: 'text-blue-500',
memory: 'text-green-500',
disk: 'text-amber-500',
temperature: 'text-rose-500',
};
const THRESHOLD_SLIDER_FILL_CLASSES: Record<ThresholdSliderMetricType, string> = {
cpu: 'bg-blue-500',
memory: 'bg-green-500',
disk: 'bg-amber-500',
temperature: 'bg-rose-500',
};
export function getThresholdSliderTextClass(type: ThresholdSliderMetricType): string {
return THRESHOLD_SLIDER_TEXT_CLASSES[type];
}
export function getThresholdSliderFillClass(type: ThresholdSliderMetricType): string {
return THRESHOLD_SLIDER_FILL_CLASSES[type];
}