"use strict";
/*---------------------------------------------------------------------------------------------
* 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
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBadgeClassName = exports.WidgetPanelsTab = void 0;
require("./Tab.scss");
const React = require("react");
const appui_layout_react_1 = require("@itwin/appui-layout-react");
const Content_1 = require("./Content");
const core_react_1 = require("@itwin/core-react");
const appui_abstract_1 = require("@itwin/appui-abstract");
/** @internal */
function WidgetPanelsTab() {
    const widgetDef = (0, Content_1.useWidgetDef)();
    const badgeType = widgetDef === null || widgetDef === void 0 ? void 0 : widgetDef.badgeType;
    const badgeClassName = getBadgeClassName(badgeType);
    const badge = React.useMemo(() => core_react_1.BadgeUtilities.getComponentForBadgeType(badgeType), [badgeType]);
    return (React.createElement(appui_layout_react_1.WidgetTab, { className: badgeClassName, badge: badge }));
}
exports.WidgetPanelsTab = WidgetPanelsTab;
/** @internal */
function getBadgeClassName(badgeType) {
    if (badgeType === appui_abstract_1.BadgeType.New)
        return "uifw-badge-new";
    else if (badgeType === appui_abstract_1.BadgeType.TechnicalPreview)
        return "uifw-badge-tp";
    return undefined;
}
exports.getBadgeClassName = getBadgeClassName;
//# sourceMappingURL=Tab.js.map