import React, { Component } from "react";
import style from './index.less'
import classNames from 'classnames';
import more from '@common/images/addItem1.png';

/**
添加组件，如添加化验项

**/

class Add extends Component {
  constructor(props){
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }

  handleClick(e){
    // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
    const {handleClick} = this.props;
    handleClick && handleClick(e);
  }

  render(){
    const {showText,handleClick,id,height} = this.props;
    return <div className={style['tag-container']} onClick={(e)=>{this.handleClick(e)}} id={id}>
        <img src={more} style={{verticalAlign:'middle'}}/>
        <span className={`inline-box ${style['gray']}`} style={{height:height?height:'',lineHeight:height?height:''}}>{showText}</span>
      </div>
  }
}

export default Add;