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

@Component({
  selector: 'app-full-spellcard',
  templateUrl: './full-spellcard.component.html',
  styleUrl: './full-spellcard.component.scss',
})
export class FullSpellcardComponent {
  @Input() public spell!: Spell;
  @Input() public isFromDashboard!: boolean;
  @Input() public alreadyInFavorites!: boolean;

  public constructor(private modalAccessor: ModalService) {}

  public delete(): void {
    this.modalAccessor.handleModalClosing('delete', undefined);
  }

  public remove(): void {
    this.modalAccessor.handleModalClosing('remove', undefined);
  }

  public update(): void {
    this.modalAccessor.handleModalClosing('update', undefined);
  }

  public addToFavorites(): void {
    this.modalAccessor.handleModalClosing('add', undefined);
  }
}
