I want to show slideshow circle buttons dynamically based on the number of slides I will get from the server. I couldn't do it with loops since I have a number of slides predefined & no array. How can I show my buttons? Now I manually created 4 buttons. (I deleted unnecessary code so that only important snippets are present).
import React = require("react");
type NavigationEvent = "Backward" | "Forward" | "Pause" | "Play";
interface Props {
slidesAmount: number;
activeSlideIndex: number;
}
function SlideshowCarouselNavigationBarComponent(props: Props) {
const onPlayButtonClicked = () => {
props.navigate("Play");
}
const onPauseButtonClicked = () => {
props.navigate("Pause");
}
const onSlideButtonClicked = index => {
props.navigateToIndex(index);
}
return (
<div>
<div>
<div className={classes.dotsContainer}>
<div className={classes.dots}>
</div>
<div className={classes.dots}>
</div>
<div className={classes.dots}>
</div>
<div className={classes.dots}>
</div>
</div>
</div>
</div>
)
}
export = SlideshowCarouselNavigationBarComponent;