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

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

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

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