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

/**
子模板组件，如添加病程变化

**/

class TailInlineTag extends Component {
  constructor(props){
    super(props);
    this.handleClick = this.handleClick.bind(this);
    this.state = {
      boxEditable:false
    }
  }

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

  render(){
    const {showText,value,suffix} = this.props;
    return <div className={style['tag-container']} onClick={(e)=>{this.handleClick(e)}}> 
        <img src={more} style={{verticalAlign:'middle'}}/>  
        <div className={`inline-box ${style['gray']}`} contentEditable="false" >
          {value||showText?<span className={style['free-in']}>{value||showText}</span>:''}
        </div>
      </div>
  }
}

export default TailInlineTag;