import { ActionFormData, uiManager } from "@minecraft/server-ui";
export class UIManagerPokemon {
    registerForm(player, formData) {
        const form = new ActionFormData();
        form.title(formData.title);
        form.body(`000000000000${formData.body || ""}`);
        formData.buttons?.forEach(button => {
            if (button.icon) {
                form.button(button.text, button.icon);
            }
            else {
                form.button(button.text);
            }
        });
        return form;
    }
    showForm(player, form, callback) {
        form.show(player).then((response) => {
            if (response.canceled || response.cancelationReason) {
                uiManager.closeAllForms(player);
                return;
            }
            callback(response, player);
        });
    }
}
