style: LEDs style

This commit is contained in:
ISA
2025-07-31 13:54:56 +02:00
parent 421e1f5425
commit 85860ae9f0
6 changed files with 41 additions and 25 deletions

View File

@@ -22,28 +22,39 @@ const FallSensors: React.FC<FallSensorsProps> = ({ slotIndex }) => {
});
return (
<div className="flex justify-center items-center gap-2 p-3 border rounded-lg bg-gray-100 shadow-sm">
{leds.map((ledStatus, ledIndex) => {
// LED Farben: grün (1), rot (0), grau (2)
let bgColor = "bg-gray-400"; // Standard grau
let statusText = "Unbekannt";
<div className="bg-gray-300 border border-gray-400 rounded p-1">
{/* Überschrift mit KVZ-Labels */}
<div className="flex justify-between items-center mb-2">
<span className="text-[8px] font-medium text-gray-700">KVZ1</span>
<span className="text-[8px] font-medium text-gray-700">KVZ2</span>
<span className="text-[8px] font-medium text-gray-700">KVZ3</span>
<span className="text-[8px] font-medium text-gray-700">KVZ4</span>
</div>
if (ledStatus === "green") {
bgColor = "bg-green-500";
statusText = "Ein";
} else if (ledStatus === "red") {
bgColor = "bg-red-500";
statusText = "Aus";
}
{/* LEDs */}
<div className="flex justify-between items-center">
{leds.map((ledStatus, ledIndex) => {
// LED Farben: grün (1), rot (0), grau (2)
let bgColor = "bg-gray-400"; // Standard grau
let statusText = "Unbekannt";
return (
<div
key={ledIndex}
className={`w-3 h-3 rounded-full border-2 border-gray-300 shadow-sm ${bgColor} transition-all duration-200 hover:scale-110 flex-shrink-0`}
title={`Slot ${slotIndex} LED${ledIndex + 1}: ${statusText}`}
/>
);
})}
if (ledStatus === "green") {
bgColor = "bg-green-500";
statusText = "Ein";
} else if (ledStatus === "red") {
bgColor = "bg-red-500";
statusText = "Aus";
}
return (
<div
key={ledIndex}
className={`w-4 h-4 rounded-full border border-gray-500 ${bgColor} flex-shrink-0`}
title={`Slot ${slotIndex} LED${ledIndex + 1}: ${statusText}`}
/>
);
})}
</div>
</div>
);
};