npm install bagpallab7_react_image_carousel
import useCarousel from "bagpallab7_react_image_carousel";
const [imageIndex,handleLeftClick,handleRightClick,handlePositionClick ] = useCarousel("length of image array", "duration of image change");
<img src={image-array-name[
imageIndex
]} />here imageIndex that you extracted from useCarousel.
onClick={handleLeftClick}
onClick={handleRightClick}
onClick={()=> handlePositionClick("pass current index of the button/position element")}