// components/main/kabelueberwachung/kue705FO/handlers/handleRefreshClick.ts
import { Dispatch, SetStateAction } from "react";
import { goLoop } from "../../../../../utils/goLoop";
import { goTDR } from "../../../../../utils/goTDR";

const handleRefreshClick = (
  activeButton: "Schleife" | "TDR",
  slotIndex: number,
  setLoading: Dispatch<SetStateAction<boolean>>
) => {
  if (activeButton === "Schleife") {
    goLoop(slotIndex, setLoading);
  } else if (activeButton === "TDR") {
    goTDR(slotIndex, setLoading);
  }
};

export default handleRefreshClick;
