"use client";
export function scrollToId(id: string) {
  if (typeof window === "undefined") return;
  console.log("Scroll to id", id, document);

  const element = document.getElementById(id);
  console.log(element);
  if (!element) return;

  element.scrollIntoView({
    behavior: "smooth",
    block: "start",
  });
}
