import { ConfigProvider } from "antd";
import classNames from "classnames";
import React, { useContext } from "react";
import { BackTo } from "../../BackTo";
import { useStyle } from "./style";
var TopOperatingArea = function(props) {
    var _props_isShowBackTo = props.isShowBackTo, isShowBackTo = _props_isShowBackTo === void 0 ? true : _props_isShowBackTo, targetRef = props.targetRef, operationBtnRender = props.operationBtnRender;
    var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
    var prefixCls = getPrefixCls('agentic-top-operating-area');
    var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
    var renderOperationButtons = function() {
        if (!operationBtnRender) return null;
        return /*#__PURE__*/ React.createElement("div", {
            className: classNames("".concat(prefixCls, "-buttons"), hashId)
        }, operationBtnRender());
    };
    return wrapSSR(/*#__PURE__*/ React.createElement("div", {
        className: classNames(prefixCls, hashId)
    }, /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(prefixCls, "-left"), hashId)
    }), /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(prefixCls, "-center"), hashId)
    }, renderOperationButtons()), /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(prefixCls, "-right"), hashId)
    }, /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(prefixCls, "-back-buttons"), "".concat(prefixCls, "-back-buttons-").concat(isShowBackTo ? 'visible' : 'hidden'), hashId)
    }, isShowBackTo && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(BackTo.Top, {
        target: targetRef ? function() {
            return targetRef.current || window;
        } : undefined,
        shouldVisible: 5,
        style: {
            position: 'relative',
            insetInlineEnd: 0,
            bottom: 0
        }
    }), /*#__PURE__*/ React.createElement(BackTo.Bottom, {
        target: targetRef ? function() {
            return targetRef.current || window;
        } : undefined,
        shouldVisible: 5,
        style: {
            position: 'relative',
            insetInlineEnd: 0,
            bottom: 0
        }
    }))))));
};
export default TopOperatingArea;
