import { useState, useEffect } from 'react'; import { useNavigate, useLocation } from 'react-router'; import { motion } from 'motion/react'; import { Check } from 'lucide-react'; const steps = [ 'Scanning website...', 'Capturing channel screenshots...', 'Analyzing social media presence...', 'Evaluating brand consistency...', 'Generating intelligence report...', ]; export default function AnalysisLoadingPage() { const [currentStep, setCurrentStep] = useState(0); const navigate = useNavigate(); const location = useLocation(); const url = (location.state as { url?: string })?.url; useEffect(() => { const timers: ReturnType[] = []; steps.forEach((_, index) => { timers.push( setTimeout(() => { setCurrentStep(index + 1); }, (index + 1) * 1250) ); }); timers.push( setTimeout(() => { navigate('/report/view-clinic', { replace: true }); }, 5500) ); return () => timers.forEach(clearTimeout); }, [navigate]); return (
{/* Radial gradient overlay */}
{/* Purple glow blob */}
{/* INFINITH logo text */} INFINITH {/* Entered URL */} {url && ( {url} )} {/* Analysis steps */}
{steps.map((step, index) => { const isCompleted = currentStep > index; const isActive = currentStep === index; return ( {/* Status icon */}
{isCompleted ? ( ) : isActive ? (
) : (
)}
{/* Step text */} {step} ); })}
{/* Progress bar */}
); }