import OathHammerItemSheet from "./base-item-sheet.mjs"

export default class OathHammerWeaponSheet extends OathHammerItemSheet {
  /** @override */
  static DEFAULT_OPTIONS = {
    classes: ["weapon"],
    position: {
      width: 620,
    },
    window: {
      contentClasses: ["weapon-content"],
    },
  }

  /** @override */
  static PARTS = {
    main: {
      template: "systems/fvtt-oath-hammer/templates/item/weapon-sheet.hbs",
    },
  }

  /** @override */
  async _prepareContext() {
    const context = await super._prepareContext()
    const enrich = (v) => foundry.applications.ux.TextEditor.implementation.enrichHTML(v ?? "", { async: true })
    context.enrichedMagicEffect = await enrich(this.document.system.magicEffect)
    return context
  }
}
