14 lines
464 B
React
Raw Normal View History

export default function UsageBar({ percent, additionalClassNames = "" }) {
const normalized = Math.min(100, Math.max(0, percent));
2022-09-09 06:45:43 +03:00
return (
<div className={`mt-0.5 w-full bg-theme-800/30 rounded-full h-1 dark:bg-theme-200/20 ${additionalClassNames}`}>
2022-09-09 06:45:43 +03:00
<div
2022-09-28 02:32:39 +03:00
className="bg-theme-800/70 h-1 rounded-full dark:bg-theme-200/50 transition-all duration-1000"
2022-09-09 06:45:43 +03:00
style={{
width: `${normalized}%`,
2022-09-09 06:45:43 +03:00
}}
/>
</div>
);
}