import { __assign, __rest } from "tslib";
import React, { useContext } from 'react';
import classNames from 'classnames';
import { ConfigContext } from '../config-provider/config-context';
import { getPrefixCls } from '../_utils/general';
import { SplitContext } from './split-context';
var SplitPane = React.forwardRef(function (props, ref) {
    var size = props.size, className = props.className, style = props.style, children = props.children, customisedCls = props.prefixCls, otherProps = __rest(props, ["size", "className", "style", "children", "prefixCls"]);
    var configContext = useContext(ConfigContext);
    var prefixCls = getPrefixCls('split-pane', configContext.prefixCls, customisedCls);
    var cls = classNames(prefixCls, className);
    var mode = useContext(SplitContext).mode;
    var paneStyle = __assign({}, style);
    if (mode === 'vertical') {
        paneStyle.width = size;
    }
    else {
        paneStyle.height = size;
    }
    return (React.createElement("div", __assign({ ref: ref }, otherProps, { className: cls, style: paneStyle }), children));
});
SplitPane.displayName = 'SplitPane';
export default SplitPane;
//# sourceMappingURL=split-pane.js.map