import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { HomeComponent } from './layout/home/home.component';
import { DashboardComponent } from './pages/dashboard/dashboard.component';
import { SignerComponent } from './pages/signer/signer.component';
import { DemandeSignatureComponent } from './pages/demande-signature/demande-signature.component';
import { SuiviSignatureComponent } from './pages/suivi-signature/suivi-signature.component';
import { EditDocumentComponent } from './components/edit-document/edit-document.component';
import { SignatureComponent } from './layout/signature/signature.component';
import { SignerDocumentComponent } from './pages/signer-document/signer-document.component';
import { ProfilComponent } from './pages/profil/profil.component';
import { WorkflowComponent } from './pages/workflow/workflow.component';
import { SignataireComponent } from './pages/signataire/signataire.component';
import { DocumentComponent } from './pages/document/document.component';
import { GlobaleComponent } from './pages/globale/globale.component';
import { HistoriqueComponent } from './pages/historique/historique.component';
import { OnlineSignatureComponent } from './layout/online-signature/online-signature.component';
import { TestComponent } from './pages/test/test.component';
import { TestDrawingComponent } from './pages/test-drawing/test-drawing.component';

const routes: Routes = [

  {
    path: '', redirectTo: 'login', pathMatch: 'full'
  },
  { path: 'esign', redirectTo: 'login', pathMatch: 'full' },
  {
    path: 'login', component: LoginComponent
  },
  {
    path: 'test', component: TestComponent
  },
  {
    path: 'testdraw', component: TestDrawingComponent
  },
  {
    path: 'online-signature/:token', component: OnlineSignatureComponent
  },
  {
    path: 'home', component: HomeComponent,
    children : [
      { path: '', component: SignatureComponent ,
      children : [
        {path : "", component : GlobaleComponent,},
      ]
      },
      { path: 'dashbord', component: DashboardComponent},
      { path: 'demande-signature', component: DemandeSignatureComponent},
      { path: 'historique', component: HistoriqueComponent},
      { path: 'signature'  ,component: SignatureComponent, 
        children : [
          {path : "",component : GlobaleComponent,},
          {path : "vue-globale", component : GlobaleComponent,},
          {path : "suivi-signature", component : SuiviSignatureComponent},
          {path : "signer", component : SignerComponent},
        ]
         
      },
      { path: 'signer-document', component: SignerDocumentComponent},
      { path: 'profils', component: ProfilComponent},
      { path: 'workflows', component: WorkflowComponent},
      { path: 'signataires', component: SignataireComponent},
      { path: 'document', component: DocumentComponent},
    ]
  },
];

@NgModule({
  imports: [RouterModule.forRoot(routes, {useHash:true})],
  exports: [RouterModule]
})
export class AppRoutingModule { }
