import { useEffect, useState } from "react"; import "./slideshow.css"; export default function Slideshow() { let listPhotos = [ { imgUrl: "https://picsum.photos/200", imgAlt: "Lorem picsum1" }, { imgUrl: "https://picsum.photos/200/200", imgAlt: "Lorem picsum2" }, { imgUrl: "https://picsum.photos/200/400", imgAlt: "Lorem picsum3" }, { imgUrl: "https://picsum.photos/200/600", imgAlt: "Lorem picsum4" }, ]; var slideIndex = 1; useEffect(() => { showSlides(slideIndex); }, []); const plusSlides = (n) => { slideIndex += n; showSlides(); }; const showSlides = () => { let i; let slides = document.getElementsByClassName("slides"); if (slideIndex > slides.length) { slideIndex = 1; } if (slideIndex < 1) { slideIndex = slides.length; } for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } slides[slideIndex - 1].style.display = "block"; }; return (