import React, { useState, useEffect } from "react" import { motion } from "framer-motion" import { useCurrentConversationState } from '../../contexts/ChatContext'; function ThinkingAnimation({ initialText = "Thinking", label: labelOverride, className = '', }: { initialText?: string; label?: string; className?: string; }) { const conv = useCurrentConversationState(); const label = labelOverride || conv?.statusLabel || initialText; const [dots, setDots] = useState(0); useEffect(() => { const id = setInterval(() => setDots(d => (d + 1) % 4), 400); return () => clearInterval(id); }, [label]); return (
{label} {'.'.repeat(dots)}
) } export default React.memo(ThinkingAnimation);