import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';


export default class WordsWordRowComponent extends Component {
  @service('word-select') selectWord;
  @service router;

  @action
  select(word) {
    if (word.strongsNumber == -1 || word.strongsNumber == null) {
      return;
    }
    this.selectWord.select(word);
    this.router.transitionTo('verse.word', word.strongsNumber);
  }

  get
  selected() {
    if(this.selectWord.isCurrentByOgntId(this.args.model)) {
      return "selected";
    } else {
      return "";
    }
  }

  get
  isNotPhrasePartial() {
    if (this.args.isPartial == true) {
      return false;
    } else {
      return true;
    }
  }

  get
  ulb()
  {
    if (this.args.model.ulb == '√') {
      return '';
    } else {
      return this.args.model.ulb;
    }
  }
}
