pgaes Verzeichnis Struktur verbessert
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// components/main/kabelueberwachung/kue705FO/kue705FO-Funktionen/handleButtonClick.ts
|
||||
import { Dispatch } from "react";
|
||||
import { setActiveMode } from "../../../../../redux/slices/chartDataSlice";
|
||||
|
||||
const handleButtonClick = (
|
||||
button: "Schleife" | "TDR",
|
||||
setActiveButton: Dispatch<React.SetStateAction<"Schleife" | "TDR">>,
|
||||
setLoopTitleText: Dispatch<React.SetStateAction<string>>,
|
||||
setLoopDisplayValue: Dispatch<React.SetStateAction<number | string>>,
|
||||
schleifenwiderstand: number,
|
||||
tdrLocation: number[] | undefined,
|
||||
slotIndex: number,
|
||||
dispatch: Dispatch<any>
|
||||
) => {
|
||||
if (button === "Schleife") {
|
||||
setActiveButton("Schleife");
|
||||
setLoopTitleText("Schleifenwiderstand [kOhm]");
|
||||
setLoopDisplayValue(schleifenwiderstand);
|
||||
dispatch(setActiveMode("Schleife"));
|
||||
} else if (button === "TDR") {
|
||||
setActiveButton("TDR");
|
||||
setLoopTitleText("Entfernung [Km]");
|
||||
setLoopDisplayValue(
|
||||
tdrLocation && tdrLocation[slotIndex] !== undefined
|
||||
? tdrLocation[slotIndex]
|
||||
: "0"
|
||||
);
|
||||
dispatch(setActiveMode("TDR"));
|
||||
}
|
||||
};
|
||||
|
||||
export default handleButtonClick;
|
||||
Reference in New Issue
Block a user