/** * ShapeOverlay.jsx * * This component renders an SVG overlay on top of an image to visually highlight * detected circles and text regions. Each shape is clickable, allowing users * to select a shape and view detailed information via a popup. */ import React from "react"; function ShapeOverlay({ imageInfo, circles, texts, setSelectedShape }) { const handleShapeClick = (e, shape) => { e.preventDefault(); e.stopPropagation(); console.log("Shape clicked:", shape); setSelectedShape(shape); }; return ( {circles.map((c) => ( handleShapeClick(e, c)} style={{ cursor: "pointer", pointerEvents: "all" }} /> ))} {texts.map((t) => ( handleShapeClick(e, t)} style={{ cursor: "pointer", pointerEvents: "all" }} /> ))} ); } export default ShapeOverlay;