explain useEffect(() => { if (!userInfo) { navigate('/login'); } else { if (!user || !user.name) { dispatch(getUserDetails('profile')); } else { setName(user.name); setEmail(user.email); } } }, [dispatch, navigate, userInfo, user]); useEffect(() => { if (success) { dispatch(getUserDetails('profile')); dispatch({ type: USER_UPDATE_PROFILE_RESET }); setMessage('Profile Updated!'); setMessageVariant('success'); } }, [dispatch, success]); const submitHandler = (e) => { e.preventDefault(); if (password !== confirmPassword) { setMessage('Passwords do not match'); setMessageVariant('danger'); } else { dispatch(updateUserProfile({ id: user._id, name, email, password })); } };