import { Routes } from '@angular/router';
import { authGuard, guestGuard } from './core/guards/auth.guard';
import { AppLayoutComponent } from './layout/app-layout.component';
import { LoginComponent } from './features/auth/login.component';
import { RegisterComponent } from './features/auth/register.component';
import { DashboardComponent } from './features/dashboard/dashboard.component';
import { BreakfastComponent } from './features/category/breakfast.component';
import { SecondBreakfastComponent } from './features/category/second-breakfast.component';
import { LunchComponent } from './features/category/lunch.component';
import { DinnerComponent } from './features/category/dinner.component';
import { AllMealsComponent } from './features/all-meals/all-meals.component';
import { ManageMealsComponent } from './features/manage-meals/manage-meals.component';
import { IngredientCatalogComponent } from './features/ingredient-catalog/ingredient-catalog.component';
import { DietTrackerComponent } from './features/diet-tracker/diet-tracker.component';
import { MealPlannerComponent } from './features/meal-planner/meal-planner.component';
import { ShoppingListComponent } from './features/shopping-list/shopping-list.component';
import { RecipeDetailPageComponent } from './features/recipe-detail/recipe-detail-page.component';
import { NotFoundComponent } from './features/not-found/not-found.component';
import { DietGeneratorComponent } from './features/diet-generator/diet-generator.component';
import { RecipeGeneratorComponent } from './features/recipe-generator/recipe-generator.component';

export const routes: Routes = [
  { path: 'login', component: LoginComponent, canActivate: [guestGuard] },
  { path: 'register', component: RegisterComponent, canActivate: [guestGuard] },
  {
    path: '',
    component: AppLayoutComponent,
    canActivate: [authGuard],
    children: [
      { path: '', component: DashboardComponent },
      { path: 'breakfast', component: BreakfastComponent },
      { path: 'second-breakfast', component: SecondBreakfastComponent },
      { path: 'lunch', component: LunchComponent },
      { path: 'dinner', component: DinnerComponent },
      { path: 'all-meals', component: AllMealsComponent },
      { path: 'manage-meals', component: ManageMealsComponent },
      { path: 'ingredients', component: IngredientCatalogComponent },
      { path: 'diet', component: DietTrackerComponent },
      { path: 'meal-planner', component: MealPlannerComponent },
      { path: 'diet-generator', component: DietGeneratorComponent },
      { path: 'recipe-generator', component: RecipeGeneratorComponent },
      { path: 'shopping-list', component: ShoppingListComponent },
      { path: 'recipes/:id', component: RecipeDetailPageComponent },
      { path: '404', component: NotFoundComponent },
      { path: '**', redirectTo: '404' },
    ],
  },
];
