import React from 'react';
import PropTypes from "prop-types";
import HeaderComponent from "../../components/CommonComponent/HeaderComponent/HeaderComponent";
require('./index.css');



export default class LeftContainer extends React.Component{
    constructor(props){
        super(props);
    }

    render(){
        let {leftInfo={},menuType=''} = this.props;
        let {taskInfo={}} = leftInfo;
        let menuInfo = JSON.parse(JSON.stringify(taskInfo));
        if(menuType){
            menuInfo = CONFIG.normalMenuList.find(t=>t.type === menuType);
            menuInfo.currentTaskNum = ("常规-"+menuInfo.text);
            menuInfo.taskName = "解答您工作中遇到的各种问题"
        }else{
            menuInfo.currentTaskNum = ("任务"+taskInfo.currentTaskNum);
        }
        return(
            <div className={"leftContainer"}>
                <div>
                    {
                        menuType ? <div className={"goBack font30"} onClick={()=>this.context.goBackTask()}>回到任务</div> : null
                    }
                    <ul>
                        <li className={"icon iconfont icon-task font90"} />
                        <li className={"taskNumber font40 col333"}>{menuInfo.currentTaskNum || ''}</li>
                        <li className={"leftText font30"}>{menuInfo.taskName || ''}</li>
                    </ul>
                </div>
            </div>
        )
    }
}

LeftContainer.contextTypes = {
    goBackTask: PropTypes.func
};