// 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" | "ISO",
  slotIndex: number,
  setLoading: Dispatch<SetStateAction<boolean>>
) => {
  if (activeButton === "Schleife") {
    goLoop(slotIndex, setLoading);
  } else if (activeButton === "TDR") {
    goTDR(slotIndex, setLoading);
  }
  // ISO has no refresh functionality
};

export default handleRefreshClick;
