import React, { useState } from 'react'
import { Entrance } from './Index';
import { selectTokenData } from '../../../../redux/login/selectors';
export const Login: React.FC = () => {
    const [_data, setData] = useState({'status': 0, email:'', code:''});
    const updateData = () => {
        //setData({ ..._data, 'status':e.status, 'email':e.email, 'code':e.code});
    }
    const { token, status_token } = useSelector(selectTokenData);
    return(
    <div className='wrapper_login'>
        <div className='login'>
        {
            { // updateData={(e) => updateData(e)} setToken={setToken}
                0: <Entrance />,
               // 1: <EntranceEmail updateData={(e) => updateData(e)}/>,
               // 2: <EnteringCode updateData={(e) => updateData(e)} data={_data}/>,
             //   3: <NewPassword email={_data.email} setToken={setToken}/>
            }[_data.status]
        }
        </div>
    </div>
    )
}

export default Login;
