import { Component, ViewChild } from '@angular/core';

@Component({
  selector: 'ability-panel',
  templateUrl: './ability-panel.component.html',
  styleUrls: ['./ability-panel.component.scss'],
})
export class AbilityPanelComponent {
  @ViewChild('abilityTable') abilityTable: any;
  @ViewChild('traitTable') traitTable: any;
  @ViewChild('spellslots') spellslots: any;
  @ViewChild('proficienciesTable') proficienciesTable: any;

  active = 1;

  public openModal() {
    switch (this.active) {
      case 1:
        this.abilityTable.openModal();
        break;
      case 2:
        this.traitTable.openModal();
        break;
      case 3:
        this.spellslots.openModal();
        break;
      case 4:
        this.proficienciesTable.openModal();
        break;
    }
  }
}
