"use client"; // /components/modules/kue705FO/charts/ChartSwitcher.tsx import React, { useState } from "react"; import ReactModal from "react-modal"; import LoopChartActionBar from "./LoopMeasurementChart/LoopChartActionBar"; import TDRChartActionBar from "./TDRChart/TDRChartActionBar"; import LoopMeasurementChart from "./LoopMeasurementChart/LoopMeasurementChart"; import TDRChart from "./TDRChart/TDRChart"; import { useSelector, useDispatch } from "react-redux"; import { RootState } from "../../../../../redux/store"; import { setChartOpen } from "../../../../../redux/slices/kabelueberwachungChartSlice"; interface ChartSwitcherProps { isOpen: boolean; onClose: () => void; } const ChartSwitcher: React.FC = ({ isOpen, onClose }) => { const dispatch = useDispatch(); const activeMode = useSelector( (state: RootState) => state.kueChartMode.activeMode ); const [isFullScreen, setIsFullScreen] = useState(false); // **Modal schließen + Redux-Status zurücksetzen** const handleClose = () => { dispatch(setChartOpen(false)); onClose(); }; // **Vollbildmodus umschalten** const toggleFullScreen = () => { setIsFullScreen(!isFullScreen); }; return ( {/* Action-Buttons */}
{/* Fullscreen-Button */} {/* Schließen-Button */}
{/* Chart-Container */}
{activeMode === "Schleife" ? ( <>

Schleifenmessung

) : ( <>

TDR-Messung

)}
); }; export default ChartSwitcher;