import { Component, Input } from '@angular/core';
import { DetailsService } from 'src/services/details/details.service';
import { Spell } from 'src/interfaces/spell';

@Component({
  selector: 'app-spell-details',
  templateUrl: './spell-details.component.html',
  styleUrls: ['./spell-details.component.scss'],
})
export class SpellDetailsComponent {
  public constructor(public detailsAccessor: DetailsService) {}

  @Input() spell!: Spell;
  @Input() modifiers: any = {};

  public attributeTranslator: any = {
    strength: 'Stärke-Rettungswurf',
    dexterity: 'Geschicklichkeits-Rettungswurf',
    constitution: 'Konstitutions-Rettungswurf',
    intelligence: 'Intelligenz-Rettungswurf',
    wisdom: 'Weisheits-Rettungswurf',
    charisma: 'Charisma-Rettungswurf',
  };

  public close(result: string): void {
    this.detailsAccessor.closePanel(result);
  }
}
