'use client'; import React, { useState } from 'react'; import { INITIAL_GROUP_RIDES } from '../../components/group-rides/fixtures'; import { GroupRideSummary } from '../../components/group-rides/types'; import { LivePackRadar } from '../../components/group-rides/live-pack-radar'; import { GroupRidesDirectory } from '../../components/group-rides/group-rides-directory'; import { JoinRideModal } from '../../components/group-rides/join-ride-modal'; import { CreateRideModal } from '../../components/group-rides/create-ride-modal'; export default function GroupRidesPage() { const [rides, setRides] = useState(INITIAL_GROUP_RIDES); const [isJoinModalOpen, setIsJoinModalOpen] = useState(false); const [isCreateModalOpen, setIsCreateModalOpen] = useState(false); const [activeAlert, setActiveAlert] = useState<{ message: string; type: 'success' | 'info' } | null>( null ); const showAlert = (message: string, type: 'success' | 'info' = 'success') => { setActiveAlert({ message, type }); setTimeout(() => { setActiveAlert(null); }, 4500); }; const handleJoinSuccess = (code: string, rideTitle: string) => { showAlert(`Successfully synchronized telemetry with "${rideTitle}" (Code: ${code})!`, 'success'); }; const handleCreateRide = (newRide: GroupRideSummary) => { setRides((prev) => [newRide, ...prev]); showAlert(`Published group run "${newRide.title}"! Pack radar is now active.`, 'success'); }; const handleRequestSlot = (rideId: string) => { setRides((prev) => prev.map((r) => { if (r.id !== rideId) return r; if (r.participantCount >= r.participantLimit) { showAlert(`Added to waitlist for "${r.title}". You will be alerted if a slot opens.`, 'info'); return { ...r, userStatus: 'waitlisted' }; } showAlert(`Slot requested for "${r.title}". Telemetry sync confirmed with Lead Marshal!`, 'success'); return { ...r, userStatus: 'joined', participantCount: r.participantCount + 1, }; }) ); }; return (
{/* Dynamic Atmospheric Glow Background Layers */}
{/* Toast Notification Alert */} {activeAlert && (
{activeAlert.type === 'success' ? 'check_circle' : 'info'} {activeAlert.message}
)} {/* Hero Section */}
{/* Eyebrow Badge */}
Live Pack Radar & Formation Telemetry
{/* Headline */}

Ride in pack formation.
Never lose a wingman.

{/* Subheading */}

Real-time rider radar, staggered formation spacing alerts, instant incident broadcast, and automated regroup checkpoints calibrated for fast canyon runs and transcontinental tours.

{/* Dual CTAs & Quick Metrics Bar */}
{/* Interactive Live Pack Radar Cockpit */}
{/* Group Ride Features Grid */}
Cockpit Architecture

Engineered for Squadron Cohesion

High-frequency mesh communications keep the entire formation synchronized through blind apexes, switchbacks, and offline mountain passes.

{/* Feature 1 */}
spatial_audio_off
01 / Paceline Audit

Staggered Paceline Warnings

Spatial audio HUD chimes dynamically sound whenever rider follow distance or lane positioning falls beneath calculated emergency stopping thresholds.

Response: <12ms arrow_forward
{/* Feature 2 */}
fmd_bad
02 / Swarm Broadcast

Crash & Separation Alerts

Autonomous IMU-based impact detection pings the entire pack instantly. Visual yellow and red telemetry flags highlight precise coordinates for immediate regrouping.

IMU Sensing: 6-Axis arrow_forward
{/* Feature 3 */}
hub
03 / Offline Link

Peer-to-Peer Mesh Sync

Never rely on cellular towers in deep canyons. High-throughput ad-hoc Bluetooth and Wi-Fi Direct protocols daisy-chain vital bike metrics from lead to sweep.

Zero-cell Ready arrow_forward
{/* Feature 4 */}
history_toggle_off
04 / Mission Debrief

Group Replay & Debrief

Relive the ride with synced multi-bike timelines. Compare apex entries, sector speeds, and individual lean angles on an interactive 3D map renderer.

3D Replay Engine arrow_forward
{/* Visual Divider / Action Interstitial */}
Hardware Compatibility

Sync directly with your helmet comms & bike dash

Integrates seamlessly with Cardo, Sena, Apple Watch, and OBD-II CAN bus links for live peg-to-peg data overlays.

headset_mic Cardo / Sena HUD
watch Haptic Alerts
{/* Active Public & Regional Group Rides Directory */} {/* Modals */} setIsJoinModalOpen(false)} onJoinSuccess={handleJoinSuccess} /> setIsCreateModalOpen(false)} onCreateRide={handleCreateRide} />
); }