import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from './components/home/home.component';
import {PostsComponent} from './components/posts/posts.component';
import {CvComponent} from './components/cv/cv.component';
import {RootComponent} from './components/root/root.component';
import {FullpostComponent} from './components/fullpost/fullpost.component';

const appRoutes: Routes = [
    {
      path: ':language',
      component: RootComponent,
      children: [
        {path: 'home', component: HomeComponent},
        {path: 'posts', component: PostsComponent},
        {path: 'cv', component: CvComponent},
        {path: 'post/:id', component: FullpostComponent}
        // {path: '', redirectTo: 'home', pathMatch: 'full'},
        // {path: '*', redirectTo: 'home', pathMatch: 'full'}
      ]
    }
  ]
;

@NgModule({
  imports: [
    RouterModule.forRoot(
      appRoutes,
      {enableTracing: false}) // <-- debugging purposes only )
  ],
  exports: [
    RouterModule
  ]
})
export class AppRoutingModule {
}
