import { Routes } from '@angular/router';
import { LandingComponent } from './feature/landing/landing.component';
import { authGuard } from './auth.guard';

export const routes: Routes = [
  {
    path: '',
    component: LandingComponent,
  },
  {
    path: 'login',
    loadComponent: () =>
      import('./feature/auth/login/login.component').then((m) => m.LoginComponent),
  },
  {
    path: 'register',
    loadComponent: () =>
      import('./feature/auth/register/register.component').then((m) => m.RegisterComponent),
  },
  {
    path: 'home',
    loadComponent: () => import('./feature/home/home.component'),
    canActivate: [authGuard],
  },
  {
    path: 'game/blackjack',
    loadComponent: () => import('./feature/game/blackjack/blackjack.component'),
    canActivate: [authGuard],
  },
  {
    path: 'game/slots',
    loadComponent: () => import('./feature/game/slots/slots.component'),
  },
  {
    path: 'game/lootboxes',
    loadComponent: () =>
      import('./feature/lootboxes/lootbox-selection/lootbox-selection.component'),
    canActivate: [authGuard],
  },
  {
    path: 'game/lootboxes/open/:id',
    loadComponent: () => import('./feature/lootboxes/lootbox-opening/lootbox-opening.component'),
    canActivate: [authGuard],
  },
];
