import Inicio from './components/inicio.vue'
import Convocatoria from './components/convocatoria.vue'
import Costos from './components/costos.vue'
import Fechas from './components/fechas.vue'
import Mesas from './components/mesas.vue'
import Registro from './components/Registro.vue'
import Ponencia from './components/Ponencia.vue'
import Admin from './components/Admin.vue'
import LoginAdmin from './components/LoginAdmin.vue'
import Login from './components/Login.vue'
import Aviso from './components/Aviso.vue'
import User from './components/User.vue'
import Recuperar from './components/Recuperar.vue'

export const routes = [
    { path: '/', component: Inicio, name: 'inicio' },
    { path: '/login', component: Login, name: 'login' },
    { path: '/convocatoria', component: Convocatoria, name: 'convocatoria' },
    { path: '/costos', component: Costos, name: 'costos' },
    { path: '/fechas', component: Fechas, name: 'fechas' },
    { path: '/mesas', component: Mesas, name: 'mesas' },
    { path: '/registro', component: Registro, name: 'registro' },
    { path: '/ponencia/:id', component: Ponencia, name: 'ponencia' },
    { path: '/admin', component: Admin, name: 'admin' },
    { path: '/loginadmin', component: LoginAdmin, name: 'loginadmin' },
    { path: '/aviso', component: Aviso, name: 'aviso' },
    { path: '/usuario/:id', component: User, name: 'user' },
    { path: '/recuperar', component: Recuperar, name: 'recuperar' },
]

// const isAuthenticated = function() {
//     if (window.localStorage.pcpumaT) {
//         return true
//     }
//     return false
// }

// router.beforeEach((to, from, next) => {
//     if (!isAuthenticated() && to.path !== '/login') {
//         return next('/login')
//     }
//     if (isAuthenticated() && to.path === '/login') {
//         return next('/')
//     }
//     next()
// })