import { useState } from "react";

export const useSlideControl = ( onFinish: () => void) => {
  const [currentSlide, setCurrentSlide] = useState(0);

  const onNext = () => {
    setCurrentSlide(currentSlide + 1);
  };

  const onPrevious = () => {
    setCurrentSlide(currentSlide - 1);
  };

  return { currentSlide, onNext, onPrevious, onFinish };
};