"use client"; import { useState, useEffect } from "react"; import ReactModal from "react-modal"; import KueEinstellung from "./KueEinstellung"; import TdrEinstellung from "./TdrEinstellung"; import Knotenpunkte from "./Knotenpunkte"; interface KueModalProps { showModal: boolean; onClose: () => void; slot: number; onModulNameChange: (id: string) => void; } export default function KueModal({ showModal, onClose, slot }: KueModalProps) { // 🧠 Tab wird initial nur einmal aus globalem Speicher geladen const [activeTab, setActiveTab] = useState<"kue" | "tdr" | "knoten">(() => { if (typeof window !== "undefined" && (window as any).__lastKueTab) { return (window as any).__lastKueTab; } return "kue"; }); // šŸ” Bei jeder Tab-Ƅnderung speichern wir ihn global useEffect(() => { if (typeof window !== "undefined") { (window as any).__lastKueTab = activeTab; } }, [activeTab]); useEffect(() => { if (typeof window !== "undefined") { window.kabelModalOpen = showModal; } }, [showModal]); return (

Steckplatz {slot + 1}

console.log("Modulname geƤndert:", id)} onClose={onClose} />
{activeTab === "tdr" && ( )} {activeTab === "knoten" && }
); }