|
| 1 | +import { useState } from "react"; |
| 2 | +import EventCard from "../../components/EventCard"; |
| 3 | + |
| 4 | +const Events = () => { |
| 5 | + const [filter, setFilter] = useState("all"); |
| 6 | + |
| 7 | + const events = [ |
| 8 | + { |
| 9 | + title: "AI Workshop", |
| 10 | + date: "2025-07-10", |
| 11 | + description: "Intro to AI, ML, and real-world applications.", |
| 12 | + image: "/images/ai.jpg", |
| 13 | + type: "past", |
| 14 | + }, |
| 15 | + { |
| 16 | + title: "Autonomous Bot Hackathon", |
| 17 | + date: "2025-08-01", |
| 18 | + description: "Build bots and compete in challenges.", |
| 19 | + image: "/images/bot.jpg", |
| 20 | + type: "upcoming", |
| 21 | + }, |
| 22 | + { |
| 23 | + title: "CAD Design Contest", |
| 24 | + date: "2025-06-20", |
| 25 | + description: "Show off your SolidWorks skills.", |
| 26 | + image: "/images/cad.jpg", |
| 27 | + type: "past", |
| 28 | + }, |
| 29 | + ]; |
| 30 | + |
| 31 | + const renderCards = () => { |
| 32 | + const filteredEvents = |
| 33 | + filter === "all" ? events : events.filter((e) => e.type === filter); |
| 34 | + |
| 35 | + return ( |
| 36 | + <div className="flex flex-wrap justify-center gap-6 mt-10"> |
| 37 | + {filteredEvents.length > 0 ? ( |
| 38 | + filteredEvents.map((event, index) => ( |
| 39 | + <EventCard key={index} {...event} /> |
| 40 | + )) |
| 41 | + ) : ( |
| 42 | + <p className="text-center col-span-full text-gray-500"> |
| 43 | + No events found. |
| 44 | + </p> |
| 45 | + )} |
| 46 | + </div> |
| 47 | + ); |
| 48 | + }; |
| 49 | + |
| 50 | + return ( |
| 51 | + <div className="relative px-4 md:px-12 py-8 overflow-hidden"> |
| 52 | + <div className="absolute top-[-80px] left-[-60px] w-72 h-72 bg-[#51B8F2] opacity-80 rounded-full blur-3xl z-0 pointer-events-none"></div> |
| 53 | + <div className="absolute top-[-60px] right-[-60px] w-56 h-56 bg-[#51B8F2] opacity-80 rounded-full blur-3xl z-0 pointer-events-none"></div> |
| 54 | + <div className="absolute bottom-[-80px] left-[-50px] w-64 h-64 bg-[#51B8F2] opacity-75 rounded-full blur-3xl z-0 pointer-events-none"></div> |
| 55 | + <div className="absolute bottom-[-60px] right-[-40px] w-48 h-48 bg-[#51B8F2] opacity-75 rounded-full blur-3xl z-0 pointer-events-none"></div> |
| 56 | + <div className="text-center"> |
| 57 | + <h2 className="text-3xl font-bold text-[#0B2044]"> |
| 58 | + Our Organised Events |
| 59 | + </h2> |
| 60 | + <p className="text-gray-500 mt-2"> |
| 61 | + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis ornare. |
| 62 | + </p> |
| 63 | + |
| 64 | + {/* Filter Buttons */} |
| 65 | + <div className="flex flex-wrap justify-center gap-4 mt-6"> |
| 66 | + {["all", "past", "upcoming"].map((type) => ( |
| 67 | + <button |
| 68 | + key={type} |
| 69 | + onClick={() => setFilter(type)} |
| 70 | + className={`px-4 py-2 rounded transition ${ |
| 71 | + filter === type |
| 72 | + ? "bg-[#0B2044] text-white" |
| 73 | + : "border border-[#0B2044] text-[#0B2044]" |
| 74 | + }`} |
| 75 | + > |
| 76 | + {type === "all" |
| 77 | + ? "View All" |
| 78 | + : type.charAt(0).toUpperCase() + type.slice(1) + " Events"} |
| 79 | + </button> |
| 80 | + ))} |
| 81 | + </div> |
| 82 | + </div> |
| 83 | + |
| 84 | + {renderCards()} |
| 85 | + </div> |
| 86 | + ); |
| 87 | +}; |
| 88 | + |
| 89 | +export default Events; |
0 commit comments