import React, { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { GALLERY_IMAGES } from '../constants'; interface GalleryImage { src: string; likes: number; comments: number; caption: string; } const GallerySection: React.FC = () => { const [selectedImage, setSelectedImage] = useState(null); // Double the images for seamless infinite scroll const duplicatedImages = [...GALLERY_IMAGES, ...GALLERY_IMAGES] as GalleryImage[]; return ( <>
H

@hotchpotsh_ceramics

24.8k followers

Follow
{/* Infinite Carousel */}
{duplicatedImages.map((img, idx) => ( setSelectedImage(img)} > {img.caption} {/* Instagram-style hover overlay */}
favorite {img.likes.toLocaleString()}
chat_bubble {img.comments}
))}
{/* Lightbox Modal */} { selectedImage && ( setSelectedImage(null)} > e.stopPropagation()} > {/* Image */}
{selectedImage.caption}
{/* Side panel */}
{/* Header */}
H
hotchpotsh_ceramics
{/* Caption */}

hotchpotsh_ceramics {selectedImage.caption}

{/* Actions */}

{selectedImage.likes.toLocaleString()} likes

{selectedImage.comments} comments

{/* Close button */}
) }
); }; export default GallerySection;