import { animateScroll } from "react-scroll";

export const scrollToSection = (sectionName: string, offset = 100): void => {
  const target = document.getElementById(sectionName);
  if (!target) return;

  const top = target.getBoundingClientRect().top + window.pageYOffset - offset;
  animateScroll.scrollTo(top, {
    duration: 600,
    smooth: "easeInOutQuart",
  });
};
