import { useLocation } from "react-router-dom";
import { flattenRoutes } from '@/routes/routes';

// 获取当前的 route 信息
export default function useRoute() {
  const routes = flattenRoutes || {};
const location = useLocation();
  const route = routes[location.pathname];
  return route;   
}
