import React from "react"; import CellData from "./CellData"; import styles from "../styles/Sidebar.module.css"; interface Cell { x: number; y: number; form_id: number; } type Props = { selectedCell: [number, number] | null; setSelectedCell: (cell: [number, number] | null) => void; map: React.MutableRefObject; }; const Sidebar: React.FC = ({ selectedCell, setSelectedCell, map }) => { const onClose = () => { setSelectedCell(null); if (map.current) map.current.removeFeatureState({ source: "grid-source" }); if (map.current && map.current.getLayer("selected-cell-layer")) { map.current.removeLayer("selected-cell-layer"); } if (map.current && map.current.getSource("selected-cell-source")) { map.current.removeSource("selected-cell-source"); } requestAnimationFrame(() => { if (map.current) map.current.resize(); }); }; return ( selectedCell && (

Cell {selectedCell[0]}, {selectedCell[1]}

{selectedCell && }
) ); }; export default Sidebar;