/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module StatusBar
 */
import * as React from "react";
import { StatusBarLabelSide, StatusBarSection } from "./StatusBarItem";
import { isArgsUtil } from "../backstage/BackstageItemUtilities";
/** Utility functions for creating and maintaining StatusBar items.
 * @public
 */
export var StatusBarItemUtilities;
(function (StatusBarItemUtilities) {
    function createDeprecatedActionItem(...[id, section, itemPriority, icon, tooltip, execute, overrides,]) {
        return {
            id,
            section,
            itemPriority,
            icon,
            tooltip,
            execute,
            ...overrides,
        };
    }
    /** Creates a StatusBar item to perform an action. */
    function createActionItem(...args) {
        if (isArgsUtil(args)) {
            const { execute = () => { }, itemPriority = 0, section = StatusBarSection.Center, icon, ...other } = args[0];
            return {
                execute,
                itemPriority,
                section,
                iconNode: icon,
                icon: icon ? React.createElement(React.Fragment, null, icon) : undefined,
                ...other,
            };
        }
        return createDeprecatedActionItem(...args);
    }
    StatusBarItemUtilities.createActionItem = createActionItem;
    function createDeprecatedLabelItem(...[id, section, itemPriority, icon, label, labelSide = StatusBarLabelSide.Right, overrides,]) {
        return {
            id,
            section,
            itemPriority,
            icon,
            label,
            labelSide,
            ...overrides,
        };
    }
    /** Creates a StatusBar item to display a label. */
    function createLabelItem(...args) {
        if (isArgsUtil(args)) {
            const { label = "", itemPriority = 0, section = StatusBarSection.Center, icon, ...other } = args[0];
            return {
                label,
                itemPriority,
                section,
                iconNode: icon,
                icon: icon ? React.createElement(React.Fragment, null, icon) : undefined,
                ...other,
            };
        }
        return createDeprecatedLabelItem(...args);
    }
    StatusBarItemUtilities.createLabelItem = createLabelItem;
    function createDeprecatedCustomItem(...[id, section, itemPriority, content, overrides,]) {
        return {
            id,
            section,
            itemPriority,
            content,
            ...overrides,
        };
    }
    /** Creates a StatusBar item to display a custom content. */
    function createCustomItem(...args) {
        if (isArgsUtil(args)) {
            const { content = undefined, itemPriority = 0, section = StatusBarSection.Center, ...other } = args[0];
            return {
                content,
                itemPriority,
                section,
                ...other,
            };
        }
        return createDeprecatedCustomItem(...args);
    }
    StatusBarItemUtilities.createCustomItem = createCustomItem;
})(StatusBarItemUtilities || (StatusBarItemUtilities = {}));
//# sourceMappingURL=StatusBarItemUtilities.js.map