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

// 获取当前的 route 信息
export default function useRoute() {
  const location = useLocation();
  const routeArr = getRouteArr();

  const currentRoute = routeArr.filter(x => x.path === location.pathname)[0];

  return currentRoute;
}
