import React from 'react';
import { connect } from 'react-redux';
import PushData from '@components/PushData';
import { TOGGLE_PUSH_DATA } from '@store/types/homePage.js';
function mapStateToProps(state){
    // console.log('state',state.print.mrInfo)
    const {showPushData,curHos } = state.homePage;
    const {mrInfo } = state.print;

    return {
        showPushData:showPushData,
        mrId:mrInfo.mrId,
        isTcm:mrInfo.isTcm,
        planCode:mrInfo.mode,
        windowHeight:state.homePage.windowHeight,
        windowWidth:state.homePage.windowWidth,
        hospitalId:curHos.hosId
    }
}


function mapDispatchToProps(dispatch) {
    return {
        togglePushData: ()=>{
            dispatch({type: TOGGLE_PUSH_DATA})
        }
    }
}

const PushDataContainer = connect(
    mapStateToProps,
    mapDispatchToProps
)(PushData)

export default PushDataContainer;