import React from 'react'
import { connect } from 'react-redux'
import { submitCaseHistoryLogAsync, clearAuthenticationState  } from '../../redux/user/user.action'
import CaseHistory from "./case-history.component"

const CaseHistoryWrapperComponent = (props) => {

    return <CaseHistory {...props}/>
}


const mapStateToProps = ({user}) => ({
    theUser:user.currentUser,
    isSubmitting: user.isFetching,
    submissionErrorMessage: user.errorMessage,
    initialValues: user.initialValues,
    showNextCardIfAvailable: user.caseHistorySubmittedSuccess,
    showCaseHistory: user.showCaseHistory
    // currentPage: educatorRegistration.currentPage
  })
  
  const mapDispatchToProps = dispatch => ({
      submitCaseForm: (data, latestValues) => dispatch(submitCaseHistoryLogAsync(data, latestValues)),
    // setCurrentUser: user => dispatch(setCurrentUser(user))
     doDismissError: () => dispatch(clearAuthenticationState())  

  })
export default connect(mapStateToProps, mapDispatchToProps)( CaseHistoryWrapperComponent)