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