/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module State
 */
import * as React from "react";
import { SafeAreaInsets } from "@itwin/appui-layout-react";
/**
 * Context used to manage safe area (feature used by devices with non-rectangular screens).
 * @public
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
export const SafeAreaContext = React.createContext(SafeAreaInsets.None); // eslint-disable-line deprecation/deprecation
/** HOC that injects SafeAreaInsets.
 * @deprecated in 3.6. Use [[SafeAreaContext]] instead.
 * @public
 */
export const withSafeArea = (
// eslint-disable-next-line @typescript-eslint/naming-convention
Component) => {
    return class WithSafeArea extends React.PureComponent {
        render() {
            const { ...props } = this.props;
            return (React.createElement(SafeAreaContext.Consumer, null, (safeAreaInsets) => (React.createElement(Component, { ...props, safeAreaInsets: safeAreaInsets }))));
        }
    };
};
//# sourceMappingURL=SafeAreaContext.js.map