esLint
This commit is contained in:
@@ -16,7 +16,7 @@ interface Props {
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
export default function Knotenpunkte({ slot, onClose }: Props) {
|
||||
export default function Knotenpunkte({ slot }: Props) {
|
||||
const [knotenNamen, setKnotenNamen] = useState<string[]>(Array(10).fill(""));
|
||||
const [linienNamen, setLinienNamen] = useState<string[]>(Array(10).fill(""));
|
||||
const [linienLaenge, setLinienLaenge] = useState<number[]>(Array(10).fill(0));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import type { RootState } from "../../../../../redux/store";
|
||||
import handleSave from "../handlers/handleSave";
|
||||
@@ -29,7 +29,7 @@ const memoryIntervalOptions = [
|
||||
|
||||
export default function KueEinstellung({
|
||||
slot,
|
||||
showModal,
|
||||
|
||||
onClose = () => {},
|
||||
onModulNameChange,
|
||||
}: Props) {
|
||||
|
||||
@@ -12,17 +12,24 @@ interface KueModalProps {
|
||||
onModulNameChange: (id: string) => void;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__lastKueTab?: "kue" | "tdr" | "knoten";
|
||||
kabelModalOpen?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
|
||||
const [activeTab, setActiveTab] = useState<"kue" | "tdr" | "knoten">(() => {
|
||||
if (typeof window !== "undefined" && (window as any).__lastKueTab) {
|
||||
return (window as any).__lastKueTab;
|
||||
if (typeof window !== "undefined" && window.__lastKueTab) {
|
||||
return window.__lastKueTab;
|
||||
}
|
||||
return "kue";
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
(window as any).__lastKueTab = activeTab;
|
||||
window.__lastKueTab = activeTab;
|
||||
}
|
||||
}, [activeTab]);
|
||||
|
||||
@@ -68,13 +75,13 @@ export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
|
||||
|
||||
<div className="flex justify-start bg-gray-100 space-x-2 p-2">
|
||||
{[
|
||||
{ label: "Allgemein", key: "kue" },
|
||||
{ label: "TDR ", key: "tdr" },
|
||||
{ label: "Knotenpunkte", key: "knoten" },
|
||||
{ label: "Allgemein", key: "kue" as const },
|
||||
{ label: "TDR ", key: "tdr" as const },
|
||||
{ label: "Knotenpunkte", key: "knoten" as const },
|
||||
].map(({ label, key }) => (
|
||||
<button
|
||||
key={key}
|
||||
onClick={() => setActiveTab(key as any)}
|
||||
onClick={() => setActiveTab(key)}
|
||||
className={`px-4 py-1 rounded-t font-bold text-sm ${
|
||||
activeTab === key
|
||||
? "bg-white text-littwin-blue"
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
"use client";
|
||||
type TdrData = {
|
||||
daempfung: string;
|
||||
geschwindigkeit: string;
|
||||
trigger: string;
|
||||
};
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__tdrCache?: Record<string, { data: any; tdrActive: boolean }>;
|
||||
__tdrCache?: Record<string, { data: TdrData; tdrActive: boolean }>;
|
||||
}
|
||||
}
|
||||
|
||||
import React, { useState, useEffect } from "react";
|
||||
import React, { useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { RootState } from "../../../../../redux/store";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user