import React from 'react'
import { Link } from 'react-router-dom'
import { connect } from 'react-redux'

import successImage from './images/tick.gif'
//can be any,even education action types. As we refer only reset state identifier
import {PatientRegistrationActionTypes} from  '../../../../redux/patient/patient.action.types'
const ConfirmSubmitCard = ({clearRegistrationStates}) => {
    return (
        <fieldset className="mt-4">
            <h2 className="success-title text-cente"><strong>Success!</strong></h2>
            <div className="text-center tick-icon mb-2">
                <img src={successImage} className="img-fluid" alt="not-available"/>
            </div>
            <div className="col-md-12 text-center">
                <h5 className="fieldset-title mb-3"><b>You Have Successfully Signed Up</b></h5>
                <p className="login-txt mb-0">Now&nbsp;
                    <Link to="/" className="clickhere" onClick={clearRegistrationStates}> Click here </Link> 
                    &nbsp;to login
                </p>
            </div>
        </fieldset>
    )
}

const mapDispatchToProps = dispatch => ({
    clearRegistrationStates:() => dispatch({
        type: PatientRegistrationActionTypes.RESET_STATE        
    })
})
export default connect(null, mapDispatchToProps)(ConfirmSubmitCard)