diff --git a/components/main/kabelueberwachung/kue705FO/modals/TdrEinstellung.tsx b/components/main/kabelueberwachung/kue705FO/modals/TdrEinstellung.tsx index 50590d2..b16f313 100644 --- a/components/main/kabelueberwachung/kue705FO/modals/TdrEinstellung.tsx +++ b/components/main/kabelueberwachung/kue705FO/modals/TdrEinstellung.tsx @@ -1,7 +1,12 @@ -// components/main/kabelueberwachung/kue705FO/modals/TdrEinstellung.tsx "use client"; -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; + +declare global { + interface Window { + win_tdrActive?: number[]; + } +} interface Props { slot: number; @@ -15,24 +20,45 @@ export default function TdrEinstellung({ slot }: Props) { trigger: "", }); - return ( -
- {/* -

- TDR-Einstellung – Slot {slot + 1} -

- - */} + useEffect(() => { + if ( + typeof window !== "undefined" && + Array.isArray(window.win_tdrActive) && + typeof window.win_tdrActive[slot] !== "undefined" + ) { + const status = parseInt(String(window.win_tdrActive[slot])); + setTdrActive(status === 1); + } else { + console.warn("⚠️ win_tdrActive ist nicht definiert oder Slot ungültig"); + } + }, [slot]); -
-