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';

const routes: Routes = [
  {
    path: '',
    component: JournalHomeComponent,
    children: [
      { path: '', component: JournalStatsComponent },
      { path: 'stats', component: JournalStatsComponent },
      { path: 'character', component: JournalCharacterComponent },
      { path: 'inventory', component: JournalInventoryComponent },
      { path: 'spellbook', component: JournalSpellbookComponent },
      { path: 'spellcards', component: JournalSpellcardsComponent },
      { path: '**', redirectTo: '/stats', pathMatch: 'full' },
    ],
  },
];

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