/*---------------------------------------------------------------------------------------------
 * 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)) {
        return {
            ...item,
            badgeType: item.badge, // eslint-disable-line deprecation/deprecation
            badgeKind: item.badgeKind,
            isCustom: true,
            icon: item.iconNode ?? item.icon, // eslint-disable-line deprecation/deprecation
            panelContentNode: item.panelContent,
        };
    }
    if (isToolbarGroupItem(item)) {
        return {
            ...item,
            items: item.items.map(toUIAToolbarItem),
            badgeType: item.badge, // eslint-disable-line deprecation/deprecation
            badgeKind: item.badgeKind,
            icon: item.iconNode ?? item.icon, // eslint-disable-line deprecation/deprecation
        };
    }
    return {
        ...item,
        badgeType: item.badge, // eslint-disable-line deprecation/deprecation
        badgeKind: item.badgeKind,
        icon: item.iconNode ?? item.icon, // eslint-disable-line deprecation/deprecation
    };
}
//# sourceMappingURL=toUIAToolbarItem.js.map