import {Routes} from '@angular/router';

import {Dashboard} from './pages/dashboard/dashboard';
import {Sidebar} from './components/sidebar/sidebar';
import {Login} from './pages/login/login';
import RegisterComponent from './pages/register/register.component';
import PasswordResetInitComponent from './pages/password-reset/init/password-reset-init.component';
import PasswordResetFinishComponent from './pages/password-reset/finish/password-reset-finish.component';
// import { UserRouteAccessService } from './core/auth/user-route-access.service'; // Si besoin
/*
// Routes d'erreur simples
const errorRoute: Routes = [
  {
    path: '404',
    loadComponent: () => import('./layouts/error/error.component').then(c => c.ErrorComponent),
    title: 'Page non trouvée',
  },
];*/


const routes: Routes = [
  {
    path: '',
    pathMatch: 'full',
    redirectTo: 'dashboard',
  },

  {
    path: '',
    component: Sidebar,
    outlet: 'sidebar',
  },


  {
    path: 'login',
    component: Login,
    title: 'Connexion',
  },
  {
    path: 'register',
    component: RegisterComponent,
    title: 'register.title',
  }, {
    path: 'reset/request',
    component: PasswordResetInitComponent,
    title: 'password',
  },
  {
    path: 'reset/finish',
    component: PasswordResetFinishComponent,
    title: 'password',
  },
  {
    path: '',
    children: [
      {
        path: 'dashboard',
        component: Dashboard,
        title: 'Tableau de Bord IA',
      },
    ]
  },

  //...errorRoute,
];

export default routes;
