import React from "react"; import { Flex, Image as UIImage, IconButton } from "theme-ui"; import AddIcon from "../../icons/AddIcon"; import RemoveIcon from "../../icons/RemoveIcon"; function MapSelect({ maps, selectedMap, onMapSelect, onMapAdd, onMapRemove }) { const tileProps = { m: 2, bg: "muted", }; const tileStyle = { width: "150px", height: "150px", borderRadius: "4px", justifyContent: "center", alignItems: "center", cursor: "pointer", }; function tile(map) { return ( onMapSelect(map)} > {!map.default && map.id === selectedMap && ( { e.preventDefault(); e.stopPropagation(); onMapRemove(map.id); }} sx={{ position: "absolute", top: 0, right: 0 }} > )} ); } return ( {maps.map(tile)} ); } export default MapSelect;