/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Toolbar
 */
import { isToolbarCustomItem, isToolbarGroupItem } from "./ToolbarItem";
/** @internal */
export function toUIAToolbarItem(item) {
    if (isToolbarCustomItem(item)) {
        // eslint-disable-next-line deprecation/deprecation
        const customItem = {
            ...item,
            badgeType: item.badge,
            isCustom: true,
            icon: item.icon,
            panelContentNode: item.panelContent,
        };
        return customItem;
    }
    if (isToolbarGroupItem(item)) {
        return {
            ...item,
            items: item.items.map(toUIAToolbarItem),
            badgeType: item.badge,
        };
    }
    return {
        ...item,
        badgeType: item.badge,
    };
}
//# sourceMappingURL=toUIAToolbarItem.js.map