import { jsx as _jsx } from "react/jsx-runtime";
import { createPortal } from 'react-dom';
import { ScrollToTopButton } from '../../ScrollToTopButton';
export const OnTopButton = ({ isActive, scrollRef, handleScrollToTop, }) => {
    const parentElement = scrollRef?.current?.parentElement;
    if (isActive && parentElement) {
        return createPortal(_jsx(ScrollToTopButton, { onClick: handleScrollToTop }), parentElement);
    }
    return null;
};
