import { Navigate, useRoutes } from "react-router-dom";
import { RouteObject } from "@/routers/interface";
import Nightingale from "@/views/nightingale/index";
// import {lazy} from 'react'
// * 处理路由
export const rootRouter: RouteObject[] = [
	{
		path: "/",
		element: <Navigate to="/nightingale" />
	},
	{
		path: "/nightingale",
		element: <Nightingale />
	},
	{
		path: "*",
		element: <Navigate to="/404" />
	}
];

const Router = () => {
	const routes = useRoutes(rootRouter);
	return routes;
};

export default Router;
