import React, { Component } from "react";
import PatInfoContainer from '@containers/PatInfoContainer.js';
import style from "./index.less";
import historyCase from '@common/images/history.png';
import health from '@common/images/health.png'
import store from '@store';
import { showHistory } from '@store/actions/historyTemplates';
import { initItemList } from '@store/async-actions/historyTemplates';
import HistoryCases from '@containers/HistoryCases';

class InfoTitle extends Component {
    constructor(props){
        super(props);
        this.showHistoryBox = this.showHistoryBox.bind(this)
    }
    showHistoryBox(){
        store.dispatch(initItemList());
        store.dispatch(showHistory(true))
    }
    render() {
        return <div className={style['title-wrapper']} >
            <PatInfoContainer />
            <div className={style["operations"]} onClick={this.showHistoryBox}>
                <span><img src={historyCase} />&nbsp;历史病历</span>
            </div>
            <div className={style["health"]} >
                <span><img src={health} />&nbsp;健康档案</span>
            </div>
            <HistoryCases></HistoryCases>
        </div>;
    }
}

export default InfoTitle;
