Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Carousel = props => {
const classes = mergeClasses(defaultClasses, props.classes);
const [carouselState, carouselApi] = useCarousel(props.images);
const { activeItemIndex, sortedImages } = carouselState;
const { handlePrevious, handleNext, setActiveItemIndex } = carouselApi;
const handleThumbnailClick = useCallback(
index => {
setActiveItemIndex(index);
},
[setActiveItemIndex]
);
const currentImage = sortedImages[activeItemIndex] || {};
const src = currentImage.file
? resourceUrl(currentImage.file, {
type: 'image-product',
width: DEFAULT_IMAGE_WIDTH,