import React, { FC, useState, useRef, useEffect } from 'react'; import { motion } from 'framer-motion'; interface AnimatedTextProps { text: string; } /** * Character-by-character scroll-reveal text animation. * Uses Framer Motion's useScroll hook. */ export const AnimatedText: FC = ({ text }) => { const containerRef = useRef(null); if (!containerRef) return {text}; return ( {text.split('').map((char, index) => ( {char === ' ' ? '\u00A0' : char} {/* Use non-breaking space for spaces */} ))} ); };