feat(Kue705FO): replace switch buttons with direct chart access buttons

- Remove Schleife/TDR switch buttons and separate Messkurve button
- Add "TDR Messkurve" and "Schleife Messkurve" buttons for direct chart access
- Each button opens the corresponding chart type directly
- Improve user experience by reducing clicks needed to access specific charts
- Clean up unused imports (handleButtonClick, tdrLocation, tdrActive)
This commit is contained in:
ISA
2025-07-25 11:47:38 +02:00
parent cfe838dd07
commit 4af7836a54
6 changed files with 36 additions and 41 deletions

View File

@@ -405,31 +405,8 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
>
Messkurve
</button>
<div className="flex mt-3 space-x-[0.063rem] ">
<button
onClick={() =>
handleButtonClick(
"Schleife",
setActiveButton,
setloopTitleText,
(value) =>
setLoopDisplayValue(
typeof value === "number" ? value : Number(value)
), // Hier sicherstellen, dass nur number übergeben wird
Number(schleifenwiderstand), // <- Stelle sicher, dass es eine Zahl ist
tdrLocation,
dispatch,
slotIndex
)
}
className={`w-[50%] h-[1.563rem] text-white text-[0.625rem] flex items-center justify-center ${
activeButton === "Schleife"
? "bg-littwin-blue"
: "bg-gray-400"
}`}
>
Schleife
</button>
{/* TDR Messkurve und Schleife Messkurve Buttons */}
<div className="flex flex-col space-y-2 w-full">
<button
onClick={() => {
setActiveButton("TDR");
@@ -446,19 +423,32 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
(latestTdrDistanceMeters / 1000).toFixed(3)
);
setLoopDisplayValue(latestTdrDistance);
handleOpenChartModal(
setShowChartModal,
dispatch,
slotIndex,
"TDR"
);
}}
className={`w-[50%] h-[1.563rem] text-white text-[0.625rem] flex items-center justify-center ${
Array.isArray(tdrActive) && tdrActive[slotIndex] === 0
? "bg-gray-200 cursor-not-allowed" // Deaktiviert: Hellgrau
: activeButton === "TDR"
? "bg-littwin-blue" // Aktiviert: Littwin Blau
: "bg-gray-400" // Nicht geklickt: Dunkelgrau
}`}
disabled={
Array.isArray(tdrActive) && tdrActive[slotIndex] === 0
} // Button deaktiviert, wenn TDR für diesen Slot nicht aktiv ist
className="w-full h-[1.563rem] bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center"
>
TDR
TDR Messkurve
</button>
<button
onClick={() => {
setActiveButton("Schleife");
setloopTitleText("Schleifenwiderstand [kOhm]");
setLoopDisplayValue(Number(schleifenwiderstand));
handleOpenChartModal(
setShowChartModal,
dispatch,
slotIndex,
"Schleife"
);
}}
className="w-full h-[1.563rem] bg-littwin-blue text-white text-[0.625rem] flex items-center justify-center"
>
Schleife Messkurve
</button>
</div>
</div>