import MournbladeCYD2ItemSheetV2 from "./base-item-sheet.mjs";

export default class MournbladeCYD2RuneSheet extends MournbladeCYD2ItemSheetV2 {

  /** @override */
  static DEFAULT_OPTIONS = {
    ...super.DEFAULT_OPTIONS,
    classes: [...super.DEFAULT_OPTIONS.classes, "rune"],
    window: {
      ...super.DEFAULT_OPTIONS.window,
      title: "SHEETS.Item.rune",
    },
  };

  /** @override */
  static PARTS = {
    main: {
      template: "systems/fvtt-mournblade-cyd-2-0/templates/item-rune-sheet.hbs",
    },
  };

  #getTabs() {
    const tabs = {
      details: { id: "details", group: "primary", label: "Détails" },
      description: { id: "description", group: "primary", label: "Description" }
    };
    for (const v of Object.values(tabs)) {
      v.active = this.tabGroups[v.group] === v.id;
      v.cssClass = v.active ? "active" : "";
    }
    return tabs;
  }
  /** @override */
  async _prepareContext() {
    const context = await super._prepareContext();
    context.tabs = this.#getTabs();
    return context;
  }
}
