mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
17 lines
488 B
JavaScript
17 lines
488 B
JavaScript
export const iconClassForLabel = (label) => {
|
|
const lowerType = label.type && label.type.toLowerCase();
|
|
const lowerDisplayText = label.display_text && label.display_text.toLowerCase();
|
|
|
|
if (lowerType === 'all') return 'hosts';
|
|
|
|
switch (lowerDisplayText) {
|
|
case 'offline': return 'offline';
|
|
case 'online': return 'success-check';
|
|
case 'mia': return 'mia';
|
|
case 'unknown': return 'single-host';
|
|
default: return 'label';
|
|
}
|
|
};
|
|
|
|
export default iconClassForLabel;
|