"use client"; import { FaArrowUp } from "react-icons/fa"; import { handleScrollToTop } from "@/handlers/scrollHandlers"; import { useEffect, useRef } from "react"; const ScrollToTopButton = ({ isLgScreen }: { isLgScreen: boolean }) => { const scrollToTopElementRef = useRef(null); // determine scrollable element based on screen size - window or div useEffect(() => { if (isLgScreen) { scrollToTopElementRef.current = document.getElementById("tournament-table"); } }, [isLgScreen]); const scrollToTopButtonClass = isLgScreen ? "absolute bottom-0 right-3 p-10" : "fixed top-20 right-3"; return ( ); }; export default ScrollToTopButton;