This commit is contained in:
legop3
2026-01-21 14:43:47 -05:00
parent 69198a5556
commit 0b1551cabf
5 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -758,13 +758,14 @@ function OvercurrentOverlay({ motors, fill = 0, compact = false }) {
if (!motors?.length) return null;
const safeLabels = motors.map((name) => OVERCURRENT_LABELS[name] || name);
const containerClass = compact ? 'p-2' : 'p-4';
const sizeClass = compact ? 'min-w-[10rem] min-h-[3rem]' : 'min-w-[18rem] min-h-[6rem]';
const textClass = compact ? 'text-lg' : 'text-4xl';
const subTextClass = compact ? 'text-xs' : 'text-xl';
const safeFill = Math.max(0, Math.min(1, fill));
const fillWidth = `${Math.round(safeFill * 100)}%`;
return (
<div
className={`pointer-events-none absolute flex items-center justify-center bg-red-900/50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${containerClass}`}
className={`pointer-events-none absolute flex items-center justify-center bg-red-900/50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${containerClass} ${sizeClass}`}
>
<div className="relative h-full w-full">
<div className="absolute inset-0 overflow-hidden">