esLint
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user