import { useState } from "react"; import { Flex, IconButton } from "@chakra-ui/react"; import { BiLeftArrowAlt, BiRightArrowAlt } from "react-icons/bi"; interface Props { images: string[]; borderRadius?: string | number; } const Carousel = ({ images, borderRadius: bRadius }: Props) => { const [currentIndex, setCurrentIndex] = useState(0); const handleClickPrevious = () => { setCurrentIndex(currentIndex === 0 ? images.length - 1 : currentIndex - 1); }; const handleClickNext = () => { setCurrentIndex(currentIndex === images.length - 1 ? 0 : currentIndex + 1); }; if (images.length === 0) images = ["blank_profile_picture.webp"]; return ( ); }; export default Carousel;