import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Group memberships',
        component: () => import('../views/GroupOverview.vue')
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('../views/Login.vue')
    },
    {
        path: '/register',
        name: 'Create account',
        component: () => import('../views/Register.vue')
    },
    {
        path: '/createGroup',
        name: 'Create group',
        component: () => import('../views/CreateGroup.vue')
    },
    {
        path: '/group/:name',
        name: 'Group info',
        component: () => import('../views/Group.vue')
    },
    {
        path: '/user',
        name: 'Your user profile',
        component: () => import('../views/User.vue')
    },
    {
        path: '/user/:name',
        name: 'View user profile',
        component: () => import('../views/User.vue')
    },
]

export default new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
});
