import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { RawEditorComponent } from "./pages/raw-editor/raw-editor.component";
import { ConfigComponent } from "./pages/config/config.component";
import { QuestsComponent } from "./pages/config/quests/quests.component";
import { GridComponent } from "./pages/config/grid/grid.component";
import { DbsComponent } from "./pages/config/dbs/dbs.component";
import { ServersComponent } from "./pages/config/servers/servers.component";
import { ServerComponent } from "./pages/config/servers/server/server.component";
import { IslandInstanceComponent } from "./pages/config/servers/island-instance/island-instance.component";
import { MapComponent } from "./pages/config/map/map.component";
import { DiscoveryZoneComponent } from "./pages/config/servers/discovery-zone/discovery-zone.component";


const routes: Routes = [
  {path: 'raw', component: RawEditorComponent},
  {
    path: 'config', component: ConfigComponent, children: [
      {path: '', redirectTo: 'grid', pathMatch: 'full'},
      {path: 'grid', component: GridComponent},
      {path: 'dbs', component: DbsComponent},
      {path: 'quests', component: QuestsComponent},
      {path: 'servers', component: ServersComponent},
      {path: 'server/:index', component: ServerComponent},
      {path: 'server/:index/island/:islandIndex', component: IslandInstanceComponent},
      {path: 'server/:index/discovery/:discoIndex', component: DiscoveryZoneComponent},
      {path: 'map', component: MapComponent}
    ]
  }
];

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