import { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { ShieldCheck, Cpu, Layers, Lock, ArrowRight, Sparkles, Binary, Radio, CheckCircle2, } from 'lucide-react'; import { useModalA11y } from '../hooks/useModalA11y'; interface PlatformLaunchModalProps { isOpen: boolean; onClose?: () => void; onComplete: () => void; } interface StageInfo { id: number; label: string; subtext: string; tag: string; icon: typeof Lock; color: string; glow: string; } const STAGES: StageInfo[] = [ { id: 1, label: 'mTLS 1.3 & Vault PKI Handshake', subtext: 'Authenticating consortium bank node on-premises certificates', tag: 'FIPS 140-3 · 1.2ms', icon: Lock, color: '#6366f1', glow: 'rgba(99, 102, 241, 0.4)', }, { id: 2, label: 'Post-Quantum Kyber-768 Exchange', subtext: 'Negotiating NIST FIPS 203 KEM & Dilithium-3 quantum-safe keys', tag: 'PQC Lattice · Bound', icon: Binary, color: '#8b5cf6', glow: 'rgba(139, 92, 246, 0.4)', }, { id: 3, label: 'PyTorch GAT & Rényi DP Noise Calibration', subtext: 'Computing 8-head structural embeddings with Opacus (ε=1.0, δ=1e-5)', tag: '12.8k Graphs · Active', icon: Layers, color: '#06b6d4', glow: 'rgba(6, 182, 212, 0.4)', }, { id: 4, label: 'Intel SGX Enclave & Paillier HE Sum', subtext: 'Hardware TEE blind homomorphic summation & zk-SNARK attestation', tag: 'Groth16 BN254 · <5ms', icon: Cpu, color: '#10b981', glow: 'rgba(16, 185, 129, 0.4)', }, { id: 5, label: 'Byzantine Krum Defense & Global Weights', subtext: 'Adversarial poisoning filtered. Dispatching consortium model', tag: '94.2% Acc · Consensus', icon: ShieldCheck, color: '#38bdf8', glow: 'rgba(56, 189, 248, 0.4)', }, { id: 6, label: 'Inter-Bank FININT & UNODC goAML Active', subtext: 'Curve25519 ECDH bridge · UNODC goAML 4.0 XML & EU AMLA Single Rulebook ready', tag: 'UNODC · EU AMLA', icon: ShieldCheck, color: '#f59e0b', glow: 'rgba(245, 158, 11, 0.4)', }, { id: 7, label: 'Asset Recovery & FININT Operational Hub', subtext: 'EUR recall KPIs · MTTR analytics · mule chain containment live', tag: 'ISO 20022 · EPC SCT', icon: Radio, color: '#10b981', glow: 'rgba(16, 185, 129, 0.4)', }, ]; const BANK_NODES = [ { id: 'JPM', name: 'JPMorgan', role: 'Bank Alpha', x: 20, y: 75, color: '#6366f1' }, { id: 'HSB', name: 'HSBC', role: 'Bank Beta', x: 80, y: 75, color: '#a855f7' }, { id: 'DBK', name: 'Deutsche', role: 'Bank Gamma', x: 50, y: 18, color: '#06b6d4' }, ]; export default function PlatformLaunchModal({ isOpen, onClose, onComplete }: PlatformLaunchModalProps) { const [currentStageIdx, setCurrentStageIdx] = useState(0); const [progress, setProgress] = useState(0); const { containerRef } = useModalA11y({ isOpen, onClose: onClose || onComplete, closeOnEscape: true, trapFocus: true, restoreFocus: true, }); useEffect(() => { if (!isOpen) { setCurrentStageIdx(0); setProgress(0); return; } const TOTAL_DURATION_MS = 950; const UPDATE_INTERVAL_MS = 15; const startTime = Date.now(); let completionTimeout: ReturnType | null = null; const timer = setInterval(() => { const elapsed = Date.now() - startTime; const rawPct = Math.min(100, (elapsed / TOTAL_DURATION_MS) * 100); setProgress(rawPct); const computedIdx = Math.min( STAGES.length - 1, Math.floor((rawPct / 100) * STAGES.length) ); setCurrentStageIdx(computedIdx); if (rawPct >= 100) { clearInterval(timer); completionTimeout = setTimeout(() => { onComplete(); }, 100); } }, UPDATE_INTERVAL_MS); return () => { clearInterval(timer); if (completionTimeout) { clearTimeout(completionTimeout); } }; }, [isOpen, onComplete]); if (!isOpen) return null; const currentStage = STAGES[Math.min(currentStageIdx, STAGES.length - 1)]!; const StageIcon = currentStage.icon; return ( {/* Ambient Holographic Radial Background */}
{/* Modal Window Container - Zero Scroll, 100% Viewport-Friendly */} {/* Top Neon Laser Glow Bar */}
{/* Header: Minimal, High-Tech, Crisp */}

Consortium Handshake DEMO SEQUENCE

CF-Intelligence · Initialization Animation Preview

{/* Body Content */}
{/* ── 1. CINEMATIC SVG TOPOLOGY RADAR (Zero-scroll, responsive) ── */}
{/* Radar Grid Circles */}
{/* Dynamic Connection Beams */} {BANK_NODES.map((b) => ( ))} {/* Central Intel SGX Enclave Hub */}
SGX TEE
FL Coordinator
{/* 3 Bank Nodes Around Enclave */} {BANK_NODES.map((node) => (
{node.id}
{node.role}
))}
{/* ── 2. DYNAMIC FOCUSED ACTIVE STAGE CARD (Framer Motion) ── */}
STAGE 0{currentStage.id}/0{STAGES.length}

{currentStage.label}

{currentStage.subtext}

{currentStage.tag}
{/* ── 3. SYNCHRONIZED MULTI-STAGE STEP TRACKER (Dynamic Visual Breadcrumb) ── */}
{STAGES.map((s, idx) => { const stageStartPct = (idx / STAGES.length) * 100; const stageEndPct = ((idx + 1) / STAGES.length) * 100; const isDone = progress >= stageEndPct; const isCurrent = progress >= stageStartPct && progress < stageEndPct; let segmentFill = 0; if (isDone) { segmentFill = 100; } else if (isCurrent) { segmentFill = Math.min( 100, Math.max(0, ((progress - stageStartPct) / (stageEndPct - stageStartPct)) * 100) ); } return (
); })}
{/* ── 4. REAL-TIME TELEMETRY MICRO-PILLS ── */}
3 Nodes Linked
ε=1.0 DP Bound
SGX Attested
{/* Footer: Progress Bar */}
{progress >= 100 ? 'Consortium Handshake Complete · Launching...' : 'Synchronizing Consortium Data Plane...'} {Math.min(100, Math.round(progress))}%
Interactive launch preview animation Verifying runtime services concurrently
); }