import { useState } from "react"; import { useSwipeable } from "react-swipeable"; import Button from "./ui/Button"; import ArrowLeftIcon from "./icons/ArrowLeftIcon"; import ArrowRightIcon from "./icons/ArrowRightIcon"; function AmentitiesContentSlider({ srcs }: { srcs: string[] }) { const [current, setCurrent] = useState(0); const handlers = useSwipeable({ onSwipedLeft: handleNext, onSwipedRight: handlePrev, preventScrollOnSwipe: true, touchEventOptions: { passive: false, }, trackMouse: true, }); function handlePrev() { setCurrent((prev) => Math.max(0, prev - 1)); } function handleNext() { setCurrent((prev) => Math.min(srcs.length - 1, prev + 1)); } return (