import { type FC } from 'react'
import LogoImage from '../../assets/images/logo.png'
import LogoSmallImage from '../../assets/images/logo-small.svg'
import { useAuthStore } from './store/AuthStore'
import LoginStep1 from './components/LoginStep1'
import LoginStep2 from './components/LoginStep2'

const Login: FC = () => {

    const { stepLogin, phone } = useAuthStore()

    return (
        <div className='w-full h-full flex justify-center lg:py-[75px] py-4 lg:items-center lg:px-10 px-4'>
            <div className='flex w-full max-h-[812px] max-w-[1200px] bg-secondary h-full rounded-3xl overflow-hidden'>
                <div className='flex-1 min-w-[50%] overflow-y-auto  bg-white lg:px-9 px-4 py-7'>
                    <div className='flex-1 h-full flex flex-col'>
                        <img src={LogoSmallImage} className='w-8' />

                        <div className='flex flex-1 flex-col h-full justify-center'>
                            {
                                stepLogin === 1 ?
                                    <LoginStep1 />
                                    :
                                    stepLogin === 2 && !!phone ?
                                        <LoginStep2 />
                                        : null
                            }
                        </div>


                    </div>
                </div>

                <div className='flex-1 min-w-[50%] lg:flex hidden justify-center items-center'>
                    <img src={LogoImage} className='h-20' />
                </div>
            </div>
        </div>
    )
}

export default Login