diff --git a/src/components/EventCard.jsx b/src/components/EventCard.jsx index 0518c71..b9d23c6 100644 --- a/src/components/EventCard.jsx +++ b/src/components/EventCard.jsx @@ -1,44 +1,166 @@ import React, { useState, useEffect } from "react"; +import { + FaChevronLeft, + FaChevronRight, + FaCalendar, + FaMapMarkerAlt, +} from "react-icons/fa"; -const EventCard = ({ title, description, images }) => { +const EventCard = ({ title, description, images, date, location, status }) => { const [currentImageIndex, setCurrentImageIndex] = useState(0); + const [isHovered, setIsHovered] = useState(false); - // Auto-change image every 3 seconds + // Auto-change image every 3 seconds (paused on hover) useEffect(() => { - if (!images || images.length <= 1) return; // skip if 0 or 1 image + if (!images || images.length <= 1 || isHovered) return; + const interval = setInterval(() => { setCurrentImageIndex((prevIndex) => (prevIndex + 1) % images.length); }, 3000); + return () => clearInterval(interval); - }, [images]); + }, [images, isHovered]); + + const goToNextImage = () => { + if (images && images.length > 1) { + setCurrentImageIndex((prevIndex) => (prevIndex + 1) % images.length); + } + }; + + const goToPrevImage = () => { + if (images && images.length > 1) { + setCurrentImageIndex((prevIndex) => + prevIndex === 0 ? images.length - 1 : prevIndex - 1, + ); + } + }; + + const goToImage = (index) => { + setCurrentImageIndex(index); + }; + + const getStatusColor = (status) => { + switch (status?.toLowerCase()) { + case "upcoming": + return "bg-blue-50 text-blue-600 border-blue-200"; + case "ongoing": + return "bg-green-50 text-green-600 border-green-200"; + case "completed": + return "bg-gray-50 text-gray-600 border-gray-200"; + default: + return "bg-gray-50 text-gray-600 border-gray-200"; + } + }; return ( -
No image
+{description}
+ + {/* Content Section */} ++ {description || "Event description will be displayed here."} +
+ + {/* Event Meta Information */} +{description}
++ {description} +
+ + {/* Hover Effect Arrow */} ++ Discover the core values and principles that guide our engineering + community toward innovation, collaboration, and excellence in + technology. +
++ Be part of a community that's shaping the future of technology + and innovation. Connect with like-minded engineers and make an + impact. +
+