// Stencil
import { h } from "@stencil/core";
import { getIconPath } from "@genexus/mercury";
const INSERTED_ICON = getIconPath({
    category: "system",
    name: "add",
    colorType: "success"
});
const EDITED_ICON = getIconPath({
    category: "system",
    name: "edit",
    colorType: "warning"
});
const DELETED_ICON = getIconPath({
    category: "system",
    name: "substract",
    colorType: "error"
});
const WARNING_ICON = getIconPath({
    category: "system",
    name: "warning",
    colorType: "warning"
});
/**
 * Renders a visual indicator (icon and label) for a given object state.
 *
 * This helper function maps a fixed set of object states to corresponding icons
 *
 * Supported states:
 * - "inserted": Displays a green "add" icon.
 * - "modified": Displays a yellow "edit" icon.
 * - "deleted": Displays a red "subtract" icon.
 * - "conflicted": Displays a yellow "warning" icon.
 *
 * @param {ObjectState} objectState - The current state of the object.
 * @returns {HTMLChImageElement} A span element containing the corresponding icon and state label.
 */
export const renderObjectStateWithIcon = (objectState) => {
    let icon;
    switch (objectState) {
        case "inserted":
            icon = INSERTED_ICON;
            break;
        case "modified":
            icon = EDITED_ICON;
            break;
        case "deleted":
            icon = DELETED_ICON;
            break;
        case "conflicted":
            icon = WARNING_ICON;
            break;
    }
    return (h("span", { class: "custom-icon-text-wrapper" }, h("ch-image", { class: "icon-m", src: icon }), `${objectState.charAt(0).toUpperCase() + objectState.slice(1)}`));
};
/**
 * Renders a GeneXus object type as a span element containing its icon and name.
 *
 * @param {ObjectType} objectType - The GeneXus object type to render, including its `icon` and `name` properties.
 * @returns {JSX.Element} A span element with the object's icon and label.
 */
export const renderObjectTypeWithIcon = (objectType) => {
    // bring changes
    const icon = objectType.icon;
    return (h("span", { class: "custom-icon-text-wrapper" }, h("ch-image", { class: "icon-m", src: icon }), `${objectType.name}`));
};
//# sourceMappingURL=utilities.js.map
