"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pane = void 0;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module ContentView
 */
const React = require("react");
const classnames_1 = require("classnames");
/**
 * @internal
 */
function Pane(props) {
    const { children, className, split, style, size, eleRef, } = props;
    const paneClasses = React.useMemo(() => (0, classnames_1.default)("Pane", split, className), [split, className]);
    const paneStyle = React.useMemo(() => {
        const baseStyle = {
            flex: 1,
            position: "relative",
            outline: "none",
        };
        if (size !== undefined) {
            if (split === "vertical") {
                baseStyle.width = size;
            }
            else {
                baseStyle.height = size;
                baseStyle.display = "flex";
            }
            baseStyle.flex = "none";
        }
        return {
            ...style,
            ...baseStyle,
        };
    }, [size, split, style]);
    return (React.createElement("div", { ref: eleRef, className: paneClasses, style: paneStyle }, children));
}
exports.Pane = Pane;
//# sourceMappingURL=Pane.js.map