import { collection, getDocs } from "firebase/firestore"; import { useEffect, useState } from "react"; import SimpleImageSlider from "react-simple-image-slider"; import { Slide } from "react-slideshow-image"; // https://react-slideshow-image.netlify.app/?path=/story/examples-slide--default import { db } from "../firebase-config"; import "../styles/DiashowHomePage.module.scss"; function DiashowHomePage(props) { const [imageSrc, setImageSrc] = useState([]); const [height, setHeight] = useState(500); const diashowImagesCollectionRef = collection(db, "diashowImages"); useEffect(() => { async function getImages() { const data = await getDocs(diashowImagesCollectionRef); console.log(data); const urls = []; data.docs.forEach((doc) => { urls.push(doc.data().url); }); setImageSrc(urls); } getImages(); }, []); if (typeof window !== "undefined") { window.addEventListener("resize", () => { setHeight(window.innerWidth <= 3000 ? 500 : 800); }); } return (