import React , { lazy , FC } from "react" ; import Dashboard from "@/pages/dashboard" ; import LoginPage from "@/pages/login" ; import LayoutPage from "@/pages/layout" ; import WrapperRouteComponent from "./config" ; import { useRoutes , RouteObject } from "react-router-dom" ; import NotFound from "@/pages/404" ; import Project from "@/pages/project" ; const routeList = [ { path : "/" , element : < WrapperRouteComponent element = { < LayoutPage / > } />, children : [ { path : "/dashboard" , element : < WrapperRouteComponent element = { < Dashboard / > } />, } , { path : "/project/list" , element : < WrapperRouteComponent element = { < Project / > } />, } , { path : "*" , element : < WrapperRouteComponent element = { < NotFound / > } />, } , ] , } , { path : "login" , element : < WrapperRouteComponent element = { < LoginPage />}/ > , } , ] ; const RenderRouter = ( ) => { const element = useRoutes ( routeList ) ; return element ; } ; export default RenderRouter ;