import React from "react"; import { useFindGallery } from "src/core/StashService"; import { useLightbox } from "src/hooks"; import { LoadingIndicator } from "src/components/Shared"; import "flexbin/flexbin.css"; interface IProps { galleryId: string; } export const GalleryViewer: React.FC = ({ galleryId }) => { const { data, loading } = useFindGallery(galleryId); const images = data?.findGallery?.images ?? []; const showLightbox = useLightbox({ images, showNavigation: false }); if (loading) return ; const thumbs = images.map((file, index) => (
showLightbox(index)} onKeyPress={() => showLightbox(index)} > {file.title
)); return (
{thumbs}
); }; export default GalleryViewer;