import { Suspense } from "react";
import { Route, Routes } from "react-router-dom";
import routes from "./routes";

const RenderRouter = () => {
  return (
    <Suspense fallback={<div className='row-center' style={{ height: '80vh' }}>
      <div className='tac'>
        {/* <Loading color='#1BEDFF' size={30} /> */}
        <div className='fz-16 sub-text mt-1'>加载中...</div>
      </div>
    </div>}>
      <Routes>
        {routes.map(item => {
          return (
            <Route path={item.path} element={item.element} key={item.path} />
          )
        })}
      </Routes>
    </Suspense>
  )
}

export default RenderRouter;
