"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 StatusBar
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.WidgetPanelsStatusBar = void 0;
const React = require("react");
const ConfigurableUiControl_1 = require("../configurableui/ConfigurableUiControl");
const StatusBar_1 = require("../statusbar/StatusBar");
const FrontstageDef_1 = require("../frontstage/FrontstageDef");
/** @internal */
// eslint-disable-next-line deprecation/deprecation
function WidgetPanelsStatusBar(props) {
    const frontstageDef = (0, FrontstageDef_1.useActiveFrontstageDef)();
    const widgetDef = frontstageDef?.statusBar;
    if (!widgetDef)
        return null;
    const content = widgetDef.reactNode;
    const widgetControl = content === undefined
        ? // eslint-disable-next-line deprecation/deprecation
            widgetDef.getWidgetControl(
            // eslint-disable-next-line deprecation/deprecation
            ConfigurableUiControl_1.ConfigurableUiControlType.StatusBarWidget
            // eslint-disable-next-line deprecation/deprecation
            )
        : undefined;
    return (
    // eslint-disable-next-line deprecation/deprecation
    React.createElement(StatusBar_1.StatusBar, { ...props, widgetControl: widgetControl }, content));
}
exports.WidgetPanelsStatusBar = WidgetPanelsStatusBar;
//# sourceMappingURL=StatusBar.js.map