import { ArrowRight, ChevronLeft, ChevronRight, ArrowUpRight } from "lucide-react"; import { useState, useRef, useEffect } from "react"; import svgPaths from "../imports/svg-ec87ex3oms"; import { PrimaryCTAButton } from "./PrimaryCTAButton"; import { navigateTo } from "./Router"; import { sharedWebinarsData, type WebinarData } from "../data/webinarsData"; // WebinarCard Component with unified data structure and navigation interface WebinarCardProps { webinar: WebinarData; } function WebinarCard({ webinar }: WebinarCardProps) { const handleCardClick = () => { // All webinar cards now navigate to the same route for consistency navigateTo(`/webinar/${webinar.slug}`); }; const handleKeyDown = (event: React.KeyboardEvent) => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); handleCardClick(); } }; // Format date for display const formatDate = (dateString: string) => { return new Date(dateString).toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }); }; // Get status badge styling const getStatusBadge = () => { switch (webinar.status) { case 'live': return ( LIVE ); case 'upcoming': return ( UPCOMING ); case 'recorded': return ( RECORDED ); default: return null; } }; // Get action text based on status const getActionText = () => { switch (webinar.status) { case 'live': return 'Join Now'; case 'upcoming': return 'Register'; case 'recorded': return 'Watch Recording'; default: return 'Learn More'; } }; return (
{/* Image Container */}
{webinar.title} {/* Status Badge */}
{getStatusBadge()}
{/* Featured Badge */} {webinar.featured && (
Featured
)} {/* Hover Overlay */}
View Details
{/* Content */}

{webinar.title}

{webinar.presenter}

{formatDate(webinar.date)} at {webinar.time} {webinar.timezone}

{webinar.duration}

{webinar.attendees}

{/* Action Indicator - Consistent with status */}
{getActionText()}
); } export function UpcomingWebinarsSection() { const [canScrollLeft, setCanScrollLeft] = useState(false); const [canScrollRight, setCanScrollRight] = useState(true); const carouselRef = useRef(null); const checkScrollButtons = () => { if (carouselRef.current) { const { scrollLeft, scrollWidth, clientWidth } = carouselRef.current; setCanScrollLeft(scrollLeft > 0); setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 1); } }; const scrollLeft = () => { if (carouselRef.current) { carouselRef.current.scrollBy({ left: -340, behavior: 'smooth' }); } }; const scrollRight = () => { if (carouselRef.current) { carouselRef.current.scrollBy({ left: 340, behavior: 'smooth' }); } }; useEffect(() => { const carousel = carouselRef.current; if (carousel) { carousel.addEventListener('scroll', checkScrollButtons); checkScrollButtons(); // Initial check return () => carousel.removeEventListener('scroll', checkScrollButtons); } }, []); return (
{/* Left Column - Content */}
{/* Heading */}

Upcoming Corporate Webinars

{/* Description */}

Join live sessions led by leadership experts designed for professionals looking to elevate strategic thinking, decision-making, and people leadership.

{/* Navigation Controls */}
{/* CTA Button - Navigate to main webinars page */} navigateTo('/webinars')} ariaLabel="Explore all upcoming webinars" />
{/* Right Column - Carousel */}
{/* Carousel Container */}
{/* Use shared webinar data for consistency */} {sharedWebinarsData.map((webinar) => ( ))}
{/* Fade Gradient Overlay */}
); }