/** * Profile Success Screen Component * * GPay-like success animation shown after health profile form submission. * Features animated checkmark, success message, and navigation options. */ import { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { motion } from 'framer-motion'; import { Check, ArrowRight } from 'lucide-react'; import './ProfileSuccessScreen.css'; interface ProfileSuccessScreenProps { autoRedirect?: boolean; redirectDelay?: number; } export default function ProfileSuccessScreen({ autoRedirect = true, redirectDelay = 2000 }: ProfileSuccessScreenProps) { const navigate = useNavigate(); useEffect(() => { // Profile sync is now handled by the Features page which shows a // live sync overlay. We just redirect there after the success animation. if (autoRedirect) { const timer = setTimeout(() => { navigate('/features', { state: { fromProfileSync: true } }); }, redirectDelay); return () => clearTimeout(timer); } }, [autoRedirect, redirectDelay, navigate]); const handleFeatures = () => { navigate('/features', { state: { fromProfileSync: true } }); }; const handleSettings = () => { navigate('/settings'); }; return ( {/* Animated Checkmark */} {/* Ripple effect */} {/* Success Message */}

Saved!

Your health profile has been updated.

{/* Action Buttons */} {/* Auto-redirect indicator */} {autoRedirect && ( Redirecting to Health Intelligence... )}
); }