2023-10-17 23:26:55 -07:00
|
|
|
export default function UsageBar({ percent, additionalClassNames = "" }) {
|
2024-01-16 16:07:20 -08:00
|
|
|
const normalized = Math.min(100, Math.max(0, percent));
|
2022-09-09 06:45:43 +03:00
|
|
|
return (
|
2023-09-10 23:36:54 +02:00
|
|
|
<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={{
|
2024-01-16 16:07:20 -08:00
|
|
|
width: `${normalized}%`,
|
2022-09-09 06:45:43 +03:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|