// components/main/kabelueberwachung/kue705FO/hooks/useLoopDisplay.ts import { useEffect, useState } from "react"; // Keeps and updates the loop (RSL) display value only when "Schleife" active. // For ISO or TDR views we do not overwrite the displayed RSL value. const useLoopDisplay = ( rslValue: number, activeButton: "Schleife" | "TDR" | "ISO" ) => { const [loopDisplayValue, setLoopDisplayValue] = useState(rslValue); useEffect(() => { if (activeButton === "Schleife") { setLoopDisplayValue(rslValue); } }, [rslValue, activeButton]); return { loopDisplayValue, setLoopDisplayValue }; }; export default useLoopDisplay;