import React, { useContext } from 'react'; import AppControlItem from './common/AppControlItem'; import { Menu, Tooltip } from 'antd'; import { MAP_TYPES } from '../../constants'; import { IMapType } from '../../typings'; import { MapModelContext } from '../../context/MapContext'; import styles from './index.less'; import classnames from 'classnames'; function MapType() { const { mapType, setMapType } = useContext(MapModelContext); return ( } dropdown={ {MAP_TYPES.map((item) => ( { setMapType(key as IMapType); }} > {item.label} ))} } /> ); } export default MapType;