import { createRouter, createWebHistory } from 'vue-router';
import PlayerNameInput from '../components/PlayerNameInput.vue';
import Lobbies from '../components/Lobbies.vue';
import Lobby from '../components/Lobby.vue';
import Game from '../components/Game.vue';
import Scoreboard from '../components/Scoreboard.vue';

const routes = [
  {
    path: '/',
    name: 'PlayerNameInput',
    component: PlayerNameInput,
  },
  {
    path: '/lobbies',
    name: 'Lobbies',
    component: Lobbies,
  },
  {
    path: '/lobby/:code',
    name: 'Lobby',
    component: Lobby,
  },
  {
    path: '/lobby/:code/game',
    name: 'Game',
    component: Game,
  },
  {
    path: '/lobby/:code/scoreboard',
    name: 'Scoreboard',
    component: Scoreboard,
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
