'use client';

import { ReactNode, useEffect, useRef } from 'react';
import { ReactLenis } from 'lenis/react';

interface ISmoothScroll {
  children: ReactNode;
}

export default function SmoothScroll({ children }: ISmoothScroll) {
  return (
    <ReactLenis
      root
      options={{
        duration: 1.2,
        easing: (t: number) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
        wheelMultiplier: 0.8,
        touchMultiplier: 0.8,
        infinite: false
      }}>
      {children}
    </ReactLenis>
  );
}
