import React from 'react';

import { t } from '@lingui/macro';

import SPELLS from 'common/SPELLS';
import { formatPercentage } from 'common/format';
import { SpellLink } from 'interface';

import CoreAlwaysBeCasting from 'parser/shared/modules/AlwaysBeCasting';
import { When, ThresholdStyle } from 'parser/core/ParseResults';


class AlwaysBeCasting extends CoreAlwaysBeCasting {
  get 
() {
    return {
      actual: this.downtimePercentage,
      isGreaterThan: {
        minor: 0.10,
        average: 0.15,
        major: .20,
      },
      style: ThresholdStyle.PERCENTAGE,
    };
  }

  suggestions(when: When) {
    when(this.downtimeSuggestionThresholds)
      .addSuggestion((suggest, actual, recommended) => suggest(<span>Your downtime can be improved. Try to Always Be Casting (ABC), reducing time away from the boss unless due to mechanics.  If you do have to move, try casting filler spells, such as <SpellLink id={SPELLS.DEATH_COIL.id} /> or <SpellLink id={SPELLS.OUTBREAK.id} />.</span>)
          .icon('spell_mage_altertime')
          .actual(t({
      id: "deathknight.unholy.suggestions.alwaysBeCasting",
      message: `${formatPercentage(actual)}% downtime`
    }))
          .recommended(`<${formatPercentage(recommended)}% is recommended`));
  }
}

export default AlwaysBeCasting;

downtimeSuggestionThresholds