import React, { useState } from 'react'; import { motion, AnimatePresence } from 'motion/react'; import { SpecialEvent } from '../types'; interface SpecialEventsBannerProps { specialEvents: SpecialEvent[]; } const SpecialEventsBanner: React.FC = ({ specialEvents }) => { const [isOpen, setIsOpen] = useState(false); const hasEvents = specialEvents && specialEvents.length > 0; const handleRedirect = (link: string) => { window.location.href = link; }; const defaultTitle = "The Grand Chronicles of RIT"; const defaultDescription = "Hark! The tides have brought forth prestigious gatherings and legendary challenges. Seek thy destiny in the links below."; return (
{/* Background glow (Softer and centered) */}
{/* New Header: Descriptive text above the scroll */}

Special Events Registry

Tap the ancient scroll to reveal the current decrees of RIT

{/* Top Roller - Interactive */} setIsOpen(!isOpen)} className="relative z-30 w-full h-16 rounded-full shadow-[0_8px_32px_rgba(62,39,35,0.25)] border-[3px] border-[#3e2723]/60 overflow-hidden cursor-pointer active:scale-95 transition-transform" style={{ backgroundImage: 'url(/wood_roller_texture.png)', backgroundSize: '100% 100%', backgroundPosition: 'center' }} > {/* End Caps: Fixes the 'broken corner' look */}
{isOpen ? 'Tap to Close' : 'Tap to Open'}
{/* Parchment Body */} {/* Inner Shadow Shadow */}

{hasEvents ? defaultTitle : "The Void Chronicles"}

{hasEvents ? defaultDescription : "The magic portal remains dormant. Check back when the moons align."}

{specialEvents.map((event, index) => ( handleRedirect(event.link)} >

{event.title}

{event.description}

Behold
))}
{hasEvents && (
End of Scroll
)}
{/* Bottom Roller - Interactive */} setIsOpen(!isOpen)} variants={{ closed: { y: -64 }, // Perfect overlap (h-16 = 64px) open: { y: 0 } }} transition={{ duration: 0.8, ease: "easeOut" }} className="relative z-30 w-full h-16 rounded-full shadow-[0_-8px_32px_rgba(62,39,35,0.25)] border-[3px] border-[#3e2723]/60 overflow-hidden cursor-pointer active:scale-95 transition-transform" style={{ backgroundImage: 'url(/wood_roller_texture.png)', backgroundSize: '100% 100%', backgroundPosition: 'center' }} > {/* End Caps: Fixes the 'broken corner' look */}
); }; export default SpecialEventsBanner;