import { createPortal } from 'react-dom' import { motion, AnimatePresence } from 'framer-motion' import { FaChevronLeft, FaChevronRight, FaTimes } from 'react-icons/fa' import { Button } from '@/components/ui' import type { MouseEvent } from 'react' interface ImageLightboxProps { images: string[] activeIndex: number isOpen: boolean altPrefix: string getSrc: (img: string) => string onClose: () => void onChangeIndex: (index: number) => void } const ImageLightbox = ({ images, activeIndex, isOpen, altPrefix, getSrc, onClose, onChangeIndex, }: ImageLightboxProps) => { const changeBy = (delta: number) => (event: MouseEvent) => { event.stopPropagation() onChangeIndex((activeIndex + delta + images.length) % images.length) } return createPortal( {isOpen && ( <>
)} )}
, document.body, ) } export default ImageLightbox