import { Suspense } from 'react'
import { Spin } from 'antd'
import { useRoutes } from 'react-router'
import routes from './router/routes'
import './App.scss'

const App = () => {
  const element = useRoutes(routes)
  return (
    <Suspense
      fallback={
        <div
          style={{ width: '100%', height: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
          <Spin size="large" />
        </div>
      }>
      {element}
    </Suspense>
  )
}

export default App
