import React, { useEffect, useState } from "react";
import NProgress from './mynprogress'
import { Spin } from "antd";

export default function Loading() {
  const [visible, setVisible] = useState<boolean>(false)

  useEffect(()=>{
    NProgress.start()
    setVisible(true)
    return ()=>{
      NProgress.done()
    }
  })

  if(!visible) return null

  return <Spin/>
}