mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
9 lines
260 B
TypeScript
9 lines
260 B
TypeScript
import { ScrollableElement } from "@/types";
|
|
|
|
const isBrowser = () => typeof window !== "undefined";
|
|
|
|
export const handleScrollToTop = (element: ScrollableElement | null) => {
|
|
if (!isBrowser()) return;
|
|
element?.scrollTo({ top: 0, behavior: "smooth" });
|
|
};
|