import React from 'react'
import PropTypes from 'prop-types'
import SuccessTemplate from 'react-uikit/alert/templates/success'

const EmailUpdateSuccess = ({email, isShowing, logout}) => {
    const body = (
        <React.Fragment>
            An email verification link has been sent to{' '}
            <span style={{fontWeight: 600}}>{email}</span>. Please access it to
            activate your account and login.
        </React.Fragment>
    )

    return (
        <SuccessTemplate
            body={body}
            canDismiss={false}
            header="Email Updated"
            iconName="alert-success"
            isShowing={isShowing}
            onClick={logout}
        />
    )
}

EmailUpdateSuccess.propTypes = {
    body: PropTypes.string,
    email: PropTypes.string,
    header: PropTypes.string,
    iconName: PropTypes.string,
    isShowing: PropTypes.bool,
    logout: PropTypes.func,
    sendEmail: PropTypes.func,
}

export default EmailUpdateSuccess
