import React, { Component } from 'react';
import style from './index.less';
import Textarea from './Textarea';

class FollowUp extends Component {
    constructor(props){
        super(props);
        this.handleInputFollowUp = this.handleInputFollowUp.bind(this);

    }

    handleInputFollowUp(followUp) {
        const { setFollowUp } = this.props
        // const followUp = e.target.innerText || e.target.innerHTML;
        setFollowUp && setFollowUp(followUp)
    }

    render() {
        const { icon, titleStyle,titleBg, filter, title, followUp, isRead, noHeader, noTitle, textStyle} = this.props
        return(
            <div className={style['general-wrapper']}>
                {noHeader? '': <div>
                    <div className={style['general-title-box']} style={titleStyle}></div>
                    <div className={style['general-title']} ><img className={style['general-icon']} src={icon}/>{title}</div>
                </div>}
                <div className={noHeader?'':style['follow-up-box']} style={textStyle}>
                    {noTitle?'': '回访时间：'}<Textarea value={followUp} handleInputFollowUp={this.handleInputFollowUp} isRead={isRead}></Textarea>后回访，不适随诊
                </div>
            </div>
        )
    }

}

export default FollowUp;