import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { JournalHomeComponent } from './journal-home/journal-home.component';
import { JournalStatsComponent } from './journal-stats/journal-stats.component';
import { JournalCharacterComponent } from './journal-character/journal-character.component';
import { JournalInventoryComponent } from './journal-inventory/journal-inventory.component';
import { JournalSpellbookComponent } from './journal-spellbook/journal-spellbook.component';
import { JournalSpellcardsComponent } from './journal-spellcards/journal-spellcards.component';
import { JournalNotesComponent } from './journal-notes/journal-notes.component';
import { JournalQuestsComponent } from './journal-quests/journal-quests.component';
import { JournalNpcsComponent } from './journal-npcs/journal-npcs.component';
import { JournalPlacesComponent } from './journal-places/journal-places.component';
import { JournalMapsComponent } from './journal-maps/journal-maps.component';
import { JournalRulesetComponent } from './journal-ruleset/journal-ruleset.component';
import { JournalSettingsComponent } from './journal-settings/journal-settings.component';
import { DataResolverService } from 'src/services/dataResolve/data-resolver.service';

const routes: Routes = [
  {
    path: '',
    component: JournalHomeComponent,
    resolve: {
      data: DataResolverService,
    },
    children: [
      { path: 'stats', component: JournalStatsComponent },
      { path: 'character', component: JournalCharacterComponent },
      { path: 'inventory', component: JournalInventoryComponent },
      { path: 'notes', component: JournalNotesComponent },
      { path: 'spellcards', component: JournalSpellcardsComponent },

      { path: 'spellbook', component: JournalSpellbookComponent },
      { path: 'quests', component: JournalQuestsComponent },
      { path: 'npcs', component: JournalNpcsComponent },
      { path: 'places', component: JournalPlacesComponent },
      { path: 'maps', component: JournalMapsComponent },
      { path: 'ruleset', component: JournalRulesetComponent },
      { path: 'settings', component: JournalSettingsComponent },
      { path: '**', redirectTo: '/journal/stats', pathMatch: 'full' },
    ],
  },
];

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