import type { Router } from 'vue-router';

let globalRouter: Router | null = null;

export function setRouterInstance(router: Router) {
  globalRouter = router;
}

export function useGlobalRouter(): Router {
  if (!globalRouter) throw new Error('Router not initialized yet!');
  return globalRouter;
}
