import React, { Component } from 'react';
import style from './index.less';
import close from './../img/close.png';

class DrugInfo extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        const { drugInfo, hideDrugInfo } = this.props
        return (<div className={style['drug-info-wrapper']}>
                <h3 className={style['drug-title']}>{drugInfo.title}说明书  <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/> </h3>
                { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']}>
                    {drugInfo.drugDesc.map((item, index) =>{
                        return <div className={style['drug-desc-item']}>{item.title}: <span dangerouslySetInnerHTML ={{__html: item.content}}></span> </div>
                    })}
                </div> }

        </div>)
    }
}

export default DrugInfo;