import React, { useState } from "react"; import styles from "./Carousel.module.css"; // Import CSS module const Carousel = ({ selectedIndex, items, onSelect }) => { const moveToNext = () => { console.log('aa') if (selectedIndex < items.length - 1) { console.log('bb') onSelect(selectedIndex + 1); // Send the next index to the parent } }; const moveToPrev = () => { if (selectedIndex > -1) { onSelect(selectedIndex - 1); // Send the previous index to the parent } }; return (