import {connect} from 'react-redux';
import ChronicInfo from '../components/ChronicInfo';
import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
import {getTableList} from '../store/async-actions/pushMessage';

function mapStateToProps(state){
  return{
    chronicMagItem: state.diagnosticList.chronicMagItem,
    questionId: state.diagnosticList.clickDiag,
    tableList: state.pushMessage.tableList,
    showList: state.pushMessage.showList,
  }
}

function mapDispatchToProps(dispatch){
  return {
    getTableList(id){
      dispatch(getTableList(id))
      dispatch({type:SHOW_TABLE_LIST})
    },
    hideList(){
      dispatch({type:HIDE_TABLE_LIST})
    }
  }
}

const ChronicInfoContainer = connect(mapStateToProps,mapDispatchToProps)(ChronicInfo);
export default ChronicInfoContainer;