Feat: KVz Bereich in EinstellungsModal in KÜs Modal
This commit is contained in:
@@ -3,6 +3,7 @@ import { useState, useEffect } from "react";
|
||||
import ReactModal from "react-modal";
|
||||
import KueEinstellung from "./KueEinstellung";
|
||||
import TdrEinstellung from "./TdrEinstellung";
|
||||
import KvzModalView from "./KvzModalView";
|
||||
import Knotenpunkte from "./Knotenpunkte";
|
||||
|
||||
interface KueModalProps {
|
||||
@@ -14,18 +15,20 @@ interface KueModalProps {
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__lastKueTab?: "kue" | "tdr" | "knoten";
|
||||
__lastKueTab?: "kue" | "tdr" | "kvz" | "knoten";
|
||||
kabelModalOpen?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
|
||||
const [activeTab, setActiveTab] = useState<"kue" | "tdr" | "knoten">(() => {
|
||||
if (typeof window !== "undefined" && window.__lastKueTab) {
|
||||
return window.__lastKueTab;
|
||||
const [activeTab, setActiveTab] = useState<"kue" | "tdr" | "kvz" | "knoten">(
|
||||
() => {
|
||||
if (typeof window !== "undefined" && window.__lastKueTab) {
|
||||
return window.__lastKueTab;
|
||||
}
|
||||
return "kue";
|
||||
}
|
||||
return "kue";
|
||||
});
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
@@ -77,6 +80,7 @@ export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
|
||||
{[
|
||||
{ label: "Allgemein", key: "kue" as const },
|
||||
{ label: "TDR ", key: "tdr" as const },
|
||||
{ label: "KVz", key: "kvz" as const },
|
||||
{ label: "Knotenpunkte", key: "knoten" as const },
|
||||
].map(({ label, key }) => (
|
||||
<button
|
||||
@@ -105,6 +109,7 @@ export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
|
||||
{activeTab === "tdr" && (
|
||||
<TdrEinstellung slot={slot} onClose={onClose} />
|
||||
)}
|
||||
{activeTab === "kvz" && <KvzModalView slot={slot} onClose={onClose} />}
|
||||
{activeTab === "knoten" && (
|
||||
<Knotenpunkte slot={slot} onClose={onClose} />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user