/*---------------------------------------------------------------------------------------------
 * 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
 */
import "./StatusBar.scss";
import * as React from "react";
import { Div } from "@itwin/core-react";
import { Footer } from "@itwin/appui-layout-react";
import { SafeAreaContext } from "../safearea/SafeAreaContext";
import { toLayoutSafeAreaInsets } from "../safearea/SafeAreaHelpers";
import { UiFramework } from "../UiFramework";
import { StatusBarField } from "./Field";
import { StatusBarPopup } from "./Popup";
/** Status Bar React component.
 * @public
 */
export class StatusBar extends React.Component {
    render() {
        return (React.createElement(SafeAreaContext.Consumer, null, (safeAreaInsets) => {
            var _a, _b, _c;
            return (React.createElement(Footer, { className: this.props.className, onMouseEnter: UiFramework.visibility.handleWidgetMouseEnter, safeAreaInsets: toLayoutSafeAreaInsets(safeAreaInsets), style: this.props.style }, (_c = (_b = (_a = this.props.widgetControl) === null || _a === void 0 ? void 0 : _a.getReactNode) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null,
                this.props.children));
        }));
    }
}
/** StatusBar With Space Between Items React functional component
 * @public
 */
export function StatusBarSpaceBetween(props) {
    const { className, ...divProps } = props;
    return (React.createElement(Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-space-between" }));
}
/** StatusBar Left Section React functional component
 * @public
 */
export function StatusBarLeftSection(props) {
    const { className, ...divProps } = props;
    return (React.createElement(Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-left" }));
}
/** StatusBar Center Section React functional component
 * @public
 */
export function StatusBarCenterSection(props) {
    const { className, ...divProps } = props;
    return (React.createElement(Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-center" }));
}
/** StatusBar Right Section React functional component
 * @public
 */
export function StatusBarRightSection(props) {
    const { className, ...divProps } = props;
    return (React.createElement(Div, { ...divProps, mainClassName: className ? className : "uifw-statusbar-right" }));
}
/** Components used in a [[StatusBar]].
 * @public
 */
(function (StatusBar) {
    /** Field of a [[StatusBar]].
     * @beta
     */
    StatusBar.Field = StatusBarField;
    /** Popup of a [[StatusBar]].
     * @beta
     */
    StatusBar.Popup = StatusBarPopup;
})(StatusBar || (StatusBar = {}));
//# sourceMappingURL=StatusBar.js.map