WIP: POI->contextmenu ->POI bearbeiten ->Gerät: Dropdown
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user