"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OnTopButton = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_dom_1 = require("react-dom");
const ScrollToTopButton_1 = require("../../ScrollToTopButton");
const OnTopButton = ({ isActive, scrollRef, handleScrollToTop, }) => {
    const parentElement = scrollRef?.current?.parentElement;
    if (isActive && parentElement) {
        return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(ScrollToTopButton_1.ScrollToTopButton, { onClick: handleScrollToTop }), parentElement);
    }
    return null;
};
exports.OnTopButton = OnTopButton;
