import { createRouter, createWebHashHistory } from 'vue-router'
import routes from 'virtual:generated-pages'

console.log('routes : ', routes)

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes,
})

router.beforeEach((to, from) => {
  console.log(from.name, '=>', to.name)
  // if (user.value?.token)
  //   return true
  // if (!user.value?.token && to.name !== 'login')
  //   return { name: 'login' }
})

export default router
