import React from 'react'; interface StatusBarProps { label: string; value: number; maxValue: number; color: string; icon: string; } const StatusBar: React.FC = ({ label, value, maxValue, color, icon }) => { const percentage = (value / maxValue) * 100; const getBarColor = () => { if (percentage >= 70) return color; if (percentage >= 40) return '#FDE68A'; return '#FECACA'; }; return (
{icon} {label.replace(/^[^\s]+\s/, '')} {value}/{maxValue}
{percentage > 10 && (
)}
{percentage < 30 && (
⚠️ Low {label.split(' ')[1] || label}
)}
); }; export default StatusBar;