WIP: POI->contextmenu ->POI bearbeiten ->Gerät: Dropdown

This commit is contained in:
Ismail Ali
2025-03-07 18:13:09 +01:00
parent f98ee107aa
commit 5a27bc5d75
11 changed files with 82 additions and 44 deletions

View File

@@ -5,9 +5,11 @@ import { useRecoilState } from "recoil";
import { selectedPoiState } from "../../redux/slices/selectedPoiSlice";
import { currentPoiState } from "../../redux/slices/currentPoiSlice";
import { mapLayersState } from "../../redux/slices/mapLayersSlice";
import { useSelector } from "react-redux";
import { selectCurrentPoi } from "../../redux/slices/currentPoiSlice";
const PoiUpdateModal = ({ onClose, poiData, onSubmit }) => {
const currentPoi = useRecoilState(currentPoiState);
const currentPoi = useSelector(selectCurrentPoi);
const selectedPoi = useRecoilState(selectedPoiState);
const [mapLayersVisibility] = useRecoilState(mapLayersState);
@@ -168,10 +170,12 @@ const PoiUpdateModal = ({ onClose, poiData, onSubmit }) => {
};
// Erstelle Optionen für react-select
const poiTypeOptions = poiTypData.map((poiTyp) => ({
value: poiTyp.idPoiTyp,
label: poiTyp.name,
}));
const poiTypeOptions = Array.isArray(poiTypData)
? poiTypData.map((poiTyp) => ({
value: poiTyp.idPoiTyp,
label: poiTyp.name,
}))
: []; // Falls kein Array, dann leeres Array zurückgeben
const deviceOptions = filteredDevices.map((device) => ({
value: device.name,