import Button from "@mui/material/Button"; import { motion } from "framer-motion"; import React from "react"; const ThreeDMarquee = ({ images = [], className = "", cols = 4, onImageClick }) => { // Clone the image list twice const duplicatedImages = [...images, ...images]; const groupSize = Math.ceil(duplicatedImages.length / cols); const imageGroups = Array.from({ length: cols }, (_, index) => duplicatedImages.slice(index * groupSize, (index + 1) * groupSize) ); const handleImageClick = (image, globalIndex) => { if (onImageClick) { onImageClick(image, globalIndex); } else if (image.href) { window.open(image.href, image.target || "_self"); } }; return (

Now, chat for free !

Finding your perfect match just become easier

{/*
*/}
{imageGroups.map((imagesInGroup, idx) => (
{imagesInGroup.map((image, imgIdx) => { const globalIndex = idx * groupSize + imgIdx; const isClickable = image.href || onImageClick; return (
handleImageClick(image, globalIndex)} />
); })} ))}
); }; export default ThreeDMarquee;