import { motion, AnimatePresence } from 'framer-motion' import { ComposableMap, Geographies, Geography, Marker } from 'react-simple-maps' import { useState, useEffect, useRef } from 'react' import { FaFileAlt, FaGlobe, FaUsers, FaChalkboardTeacher, FaTimes, FaMapMarkerAlt, FaClock } from 'react-icons/fa' const geoUrl = "https://cdn.jsdelivr.net/npm/us-atlas@3/states-10m.json" type Coordinates = [number, number] interface Event { name: string description: string startDate: string endDate: string } interface RelationshipPoint { coordinates: Coordinates city: string state: string events: Event[] } const relationshipPoints: RelationshipPoint[] = [ { coordinates: [-106.6504, 35.0844] as Coordinates, city: "Albuquerque", state: "New Mexico", events: [{ name: "NLTC", description: "National Leadership Training Conference - NAD", startDate: "September 21, 2023", endDate: "September 24, 2023" }] }, { coordinates: [-80.8431, 35.2271] as Coordinates, city: "Charlotte", state: "North Carolina", events: [{ name: "SERID", description: "Southeast Regional Institute on Deafness Conference", startDate: "October 26, 2023", endDate: "October 29, 2023" }] }, { coordinates: [-104.9903, 39.7392] as Coordinates, city: "Denver", state: "Colorado", events: [ { name: "DBL", description: "Deaf, Blind, Limitless Conference", startDate: "March 12, 2024", endDate: "March 15, 2024" }, { name: "EHDI", description: "Early Hearing Detection Intervention Conference", startDate: "March 17, 2024", endDate: "March 19, 2024" } ] }, { coordinates: [-84.3879, 33.7490] as Coordinates, city: "Atlanta", state: "Georgia", events: [{ name: "ADARA", description: "American Deafness and Rehabilitation Association Conference", startDate: "May 28, 2024", endDate: "June 1, 2024" }] }, { coordinates: [-93.2650, 44.9778] as Coordinates, city: "Minneapolis", state: "Minnesota", events: [{ name: "ADA", description: "Americans with Disabilities Act Conference", startDate: "June 9, 2024", endDate: "June 12, 2024" }] }, { coordinates: [-87.6298, 41.8781] as Coordinates, city: "Chicago", state: "Illinois", events: [{ name: "NAD", description: "National Association of the Deaf Conference", startDate: "July 1, 2024", endDate: "July 6, 2024" }] }, { coordinates: [-98.4936, 29.4241] as Coordinates, city: "San Antonio", state: "Texas", events: [{ name: "NAP NTC", description: "National Association of Parliament - National Training Conference", startDate: "September 5, 2024", endDate: "September 8, 2024" }] }, { coordinates: [-89.4012, 43.0731] as Coordinates, city: "Madison", state: "Wisconsin", events: [{ name: "ADA", description: "Americans with Disabilities Act Conference", startDate: "October 21, 2024", endDate: "October 22, 2024" }] }, { coordinates: [-94.8191, 38.8814] as Coordinates, city: "Olathe", state: "Kansas", events: [{ name: "KSD", description: "Kansas School for the Deaf", startDate: "November 23, 2024", endDate: "November 23, 2024" }] }, { coordinates: [-115.1398, 36.1699] as Coordinates, city: "Las Vegas", state: "Nevada", events: [{ name: "Engagement Conference", description: "2024 Engagement Conference", startDate: "December 15, 2024", endDate: "December 15, 2024" }] } ] const services = [ { icon: , title: "ADA-Compliant Transcripts", description: "High-quality, accurate transcripts with speaker identification and context differentiation." }, { icon: , title: "Universal Website Design", description: "Visually appealing and accessible websites adhering to universal design principles." }, { icon: , title: "Board Communication", description: "Comprehensive protocol and tools for effective board communication." }, { icon: , title: "Training & Workshops", description: "Leadership development and parliamentary procedure training." } ] const Services = () => { const [selectedPoint, setSelectedPoint] = useState(null) const popupRef = useRef(null) const isUpcoming = (event: { startDate: string, endDate: string }) => { const eventEndDate = new Date(event.endDate) const now = new Date() // Set the end date to the end of the day eventEndDate.setHours(23, 59, 59, 999) return eventEndDate > now } useEffect(() => { const handleClickOutside = (event: MouseEvent) => { if (popupRef.current && !popupRef.current.contains(event.target as Node)) { setSelectedPoint(null) } } document.addEventListener('mousedown', handleClickOutside) return () => document.removeEventListener('mousedown', handleClickOutside) }, []) return ( Our Services {services.map((service, index) => ( {service.icon} {service.title} {service.description} ))} Our Network & Relationships {({ geographies }) => geographies.map(geo => ( )) } {relationshipPoints.map((point) => { const hasUpcomingEvent = point.events.some(event => isUpcoming(event)) return ( setSelectedPoint(point)} /> ) })} {selectedPoint && ( setSelectedPoint(null)} className="absolute top-4 right-4 text-accent-mountain hover:text-secondary bg-white/50 p-2 rounded-full" > {selectedPoint.city}, {selectedPoint.state} {selectedPoint.events .sort((a, b) => new Date(b.startDate).getTime() - new Date(a.startDate).getTime()) .map((event, index) => ( {event.name} {event.description} {event.startDate === event.endDate ? event.startDate : `${event.startDate} - ${event.endDate}`} ))} )} ) } export default Services
{service.description}
{event.description}