/**
 * 切换地图按钮
 */
import React, { Component } from 'react';
import { Row, Col } from 'antd';
export default class SwitchMap extends Component {
  constructor(props) {
    super(props);
    this.state = {
      layerSatatus: props.layerSatatus
    };
  }

  componentDidMount() {}
  componentWillReceiveProps(nextPorps) {
    this.setState({
      layerSatatus: nextPorps.layerSatatus
    });
  }
  render() {
    return (
      <div className="radio_container-switch">
        <div
          className="switch-button"
          className={
            this.state.layerSatatus==='attendance' ? 'switch-button active' : 'switch-button'
          }
          onClick={() => {
            this.props.switchMap('attendance');
          }}
        >
          <img src={require('../../../assets/images/prevention/map.png')}></img>
          <div className="text">快速搜索</div>
        </div>
        <div
          className="switch-button"
          className={
            this.state.layerSatatus==='person' ? 'switch-button active' : 'switch-button'
          }
          onClick={() => {
            this.props.switchMap('person');
          }}
        >
          <img src={require('../../../assets/images/prevention/atten.png')}></img>
          <div className="text">驻勤点分布态势</div>
        </div>
        <div
          className={
            this.state.layerSatatus==='mass' ? 'switch-button active' : 'switch-button'
          }
          onClick={() => {
            this.props.switchMap('mass');
          }}
        >
          <img src={require('../../../assets/images/prevention/mass.png')}></img>
          <div className="text">保安员分布态势</div>
        </div>
      </div>
    );
  }
}
