import React from 'react';
import {connect} from 'react-redux';
import Advice from '../components/Advice'
import { SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK } from '@store/types/pushMessage';

function mapStateToProps({pushMessage}) {
    return ({pushMessage})
}

function mapDispatchToProps(dispatch) {
    return {
        setChangeAdviceTreatment: (index, ii, changeInput) => {
            dispatch({
                type: SET_CHANGE_ADVICE_TREATMENT,
                index: index,
                ii: ii,
                changeInput: changeInput,
            })
        },
        setChangeAdviceAssay: (changeInput) => {
            dispatch({
                type: SET_CHANGE_ADVICE_ASSAY,
                changeInput:changeInput
            })
        },
        setChangeAdviceCheck: (changeInput) => {
            dispatch({
                type: SET_CHANGE_ADVICE_CHECK,
                changeInput:changeInput
            })
        }
    }
}

const AdviceContainer = connect(
    mapStateToProps,
    mapDispatchToProps
)(Advice);

export default AdviceContainer;