refactor: Code-Struktur verbessert, Handler und Logik modularisiert

- Alle Event-Handler in eigene Dateien ausgelagert:
  - `handleOpenModal.ts`, `handleCloseModal.ts`
  - `handleOpenChartModal.ts`, `handleCloseChartModal.ts`
  - `handleRefreshClick.ts`, `handleSave.ts`
- Neue Hooks zur Verwaltung von Redux-Selektoren und UI-Zuständen erstellt
- `Kue705FO.tsx` gesäubert, jetzt schlanker und übersichtlicher
- Verbesserte Wartbarkeit und Wiederverwendbarkeit der Code-Basis
This commit is contained in:
Ismail Ali
2025-02-24 19:28:46 +01:00
parent bd8e114a54
commit 47e5088e1b
7 changed files with 97 additions and 56 deletions

View File

@@ -0,0 +1,14 @@
// components/main/kabelueberwachung/kue705FO/handlers/handleCloseChartModal.ts
const handleCloseChartModal = (
setShowChartModal: (value: boolean) => void,
chartInstance: any
) => {
if (chartInstance.current) {
console.log("Chart wird beim Schließen des Modals zerstört.");
chartInstance.current.destroy();
chartInstance.current = null;
}
setShowChartModal(false);
};
export default handleCloseChartModal;