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

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

  /** @override */
  static PARTS = {
    main: {
      template: "systems/fvtt-oath-hammer/templates/item/armor-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
  }
}
