"use client";
import { useEffect } from "react";

export function ScrollToTop() {
    useEffect(() => {
        try {
            const elements = document.getElementsByClassName("homeContainer");
            if (elements.length === 0) return;
            const mainSectionWhite = elements[0];
            if (mainSectionWhite) {
                requestAnimationFrame(() => {
                    requestAnimationFrame(() => {
                        mainSectionWhite.scrollTop = 0;
                    });
                });
            }
        } catch {
            return;
        }
    }, []);

    return <></>;
}
