// RĂ´le : affiche la collection d'un outil Images dans la galerie de la visionneuse. import { useEffect, useRef } from "react"; export function ImageGallery({ images, activeIndex, focusIndex = -1, onSelect, textContent = {} }) { const galleryRef = useRef(null); useEffect(() => { if (focusIndex < 0) return; const frame = window.requestAnimationFrame(() => { galleryRef.current?.querySelector(`[data-image-index="${focusIndex}"]`)?.focus(); }); return () => window.cancelAnimationFrame(frame); }, [focusIndex]); return (
{images.map((image, index) => { const position = `${index + 1} / ${images.length}`; const label = image.label || `${textContent.imageAlt || "Image"} ${index + 1}`; return ( ); })}
); }