import React, { useEffect, useState } from 'react'
import { Outlet } from 'react-router-dom'
import BSMainLoader from '../loaders/BSMainLoader'
import Layout from '../layout/Layout'


export default function UserExist() {

    const [loading, setLoading] = useState(true)
  
    useEffect(()=>{
      const timer = setTimeout(()=>{
          setLoading(false)
      },1000)
  
      return () => clearTimeout(timer)
    },[])

  return (
    <>
    {loading ? 
        <BSMainLoader />
        :
        <Layout>
          <Outlet />
        </Layout>
    }
    </>
  )
}
