// components/main/kabelueberwachung/kue705FO/hooks/useLoopDisplay.ts
import { useEffect, useState } from "react";

const useLoopDisplay = (
  schleifenwiderstand: number,
  activeButton: "Schleife" | "TDR"
) => {
  const [loopDisplayValue, setLoopDisplayValue] =
    useState<number>(schleifenwiderstand);

  useEffect(() => {
    if (activeButton === "Schleife") {
      setLoopDisplayValue(schleifenwiderstand);
    }
  }, [schleifenwiderstand, activeButton]);

  return { loopDisplayValue, setLoopDisplayValue };
};

export default useLoopDisplay;
