import { ItemSheetL5r5e } from "./item-sheet.js";

/**
 * @extends {ItemSheet}
 */
export class ArmorSheetL5r5e extends ItemSheetL5r5e {
    /** @override */
    static get defaultOptions() {
        return foundry.utils.mergeObject(super.defaultOptions, {
            classes: ["l5r5e", "sheet", "armor"],
            template: CONFIG.l5r5e.paths.templates + "items/armor/armor-sheet.html",
        });
    }

    /** @override */
    async getData(options = {}) {
        const sheetData = await super.getData(options);

        const catObj = game.l5r5e.HelpersL5r5e.getLocalizedRawObject("chiaroscuro.armor.categories") ?? {};
        sheetData.data.armorCategories = Object.entries(catObj)
            .filter(([k]) => k !== "label")
            .map(([id, label]) => ({ id, label }));

        return sheetData;
    }
}
