import React, { useEffect, useState } from "react"; import { useRecoilValue } from 'recoil'; import { gisStationsStaticDistrictState } from '../features/gisStationState'; function DataSheet() { const GisStationsStaticDistrict = useRecoilValue(gisStationsStaticDistrictState); useEffect(() => { console.log('GisStationsStaticDistrict in DataSheet:', GisStationsStaticDistrict); }, [GisStationsStaticDistrict]); const stationListing = [ { id: 1, name: "Ammersricht BZR (FGN)" }, { id: 2, name: "Bad-Bentheim" }, { id: 3, name: "Gevelsberg" }, { id: 4, name: "Köln" }, { id: 5, name: "Olfen-Selm" }, { id: 6, name: "Plettenberg" }, { id: 7, name: "Renzenhof (RG)" }, { id: 8, name: "Schlüchtern II" }, { id: 9, name: "Wuppertal" }, // Füge hier weitere Stationen hinzu, falls nötig ]; const [checkedStations, setCheckedStations] = useState( stationListing.reduce((acc, station) => { acc[station.id] = false; return acc; }, {}) ); const handleCheckboxChange = (id) => { setCheckedStations((prev) => ({ ...prev, [id]: !prev[id], })); }; const handleStationChange = (event) => { console.log("Station selected:", event.target.value); }; const resetView = () => { console.log("View has been reset"); }; return (
{/* Dropdown */} {/* Icon */} Expand
{/* Liste der Stationen mit Checkboxen */} {stationListing.map((station) => (
handleCheckboxChange(station.id)} />
))}
); } export default DataSheet;