// components
import Lottie from 'lottie-react';
import Spring from '@components/Spring';

// assets
// import ball from '@assets/logo.json';
import logo from '@assets/logo.json';
import {useEffect, useRef} from "react";

const LoadingScreen = ({...props}) => {
    const loadRef = useRef(null);
    useEffect(()=>{
        return ()=>{
            if (loadRef.current!=null){
                loadRef.current.destroy();
            }
        }
    },[])
    return (
        <Spring {...props} className="d-flex align-items-center justify-content-center flex-1 w-100 h-100">
            {/*<Lottie animationData={ball} />*/}
            <Lottie animationData={logo} lottieRef={loadRef}/>
        </Spring>
    )
}

export default LoadingScreen
