import { Box, ImageList, ImageListItem } from "@mui/material"; import React, { useState } from "react"; import { PhotoProvider, PhotoView } from "react-photo-view"; import Loader from "../../lib/loader"; import { PopUp } from "../../lib/popup"; import { useWidth } from "../ContextProvider"; export default function Gallery(props: { open: boolean; setOpen: React.Dispatch>; images: { src: string }[]; }) { const { open, setOpen, images } = props; const resizeBase = `${ process.env.REACT_APP_IMAGES_API_URL || "https://i.metahkg.org" }/resize`; const [width] = useWidth(); const [loading, setLoading] = useState(true); return ( {loading && } {images.map((item) => ( { loading && setLoading(false); }} /> ))} ); }