/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Widget
 */
import { Icon } from "@itwin/core-react";
import { Badge } from "@itwin/core-react/internal";
import * as React from "react";
import { WidgetTab } from "../layout/widget/Tab.js";
import { useWidgetDef } from "./Content.js";
/** @internal */
export function WidgetPanelsTab() {
    const widgetDef = useWidgetDef();
    // eslint-disable-next-line @typescript-eslint/no-deprecated
    const iconSpec = widgetDef?.initialConfig?.icon;
    const icon = widgetDef?.initialConfig?.iconNode ??
        (iconSpec ? (
        // eslint-disable-next-line @typescript-eslint/no-deprecated
        React.createElement(Icon, { iconSpec: iconSpec })) : undefined);
    const iconElement = icon ? (React.isValidElement(icon) ? (icon) : (React.createElement(React.Fragment, null, icon))) : undefined;
    return (React.createElement(WidgetTab
    // eslint-disable-next-line @typescript-eslint/no-deprecated
    , { 
        // eslint-disable-next-line @typescript-eslint/no-deprecated
        badge: React.createElement(Badge, { type: widgetDef?.badgeKind || widgetDef?.badgeType }), icon: iconElement }));
}
//# sourceMappingURL=Tab.js.map