Spaces:
Running

microfunnel-api / frontend /components /ChatWindow /TypingIndicator.tsx
axeronis
refactor: Frontend + Backend modular AI Core
526e04d
Raw History Blame Contribute Delete
1.54 kB
'use client'
import { Bot } from 'lucide-react'
import { motion, AnimatePresence } from 'framer-motion'
interface TypingIndicatorProps {
isVisible: boolean
}
export function TypingIndicator({ isVisible }: TypingIndicatorProps) {
return (
<AnimatePresence>
{isVisible && (
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, scale: 0.9 }}
className="flex w-full max-w-3xl mx-auto justify-end mt-4"
>
<div className="flex gap-3 flex-row-reverse">
<div className="w-8 h-8 rounded-full bg-indigo-600 text-white flex items-center justify-center flex-shrink-0 shadow-sm mt-auto mb-1">
<Bot className="w-4 h-4" />
</div>
<div className="bg-indigo-600 text-white px-4 py-3 rounded-2xl rounded-br-none shadow-sm flex items-center gap-1">
<span className="w-1.5 h-1.5 bg-white/70 rounded-full animate-bounce [animation-delay:-0.3s]"></span>
<span className="w-1.5 h-1.5 bg-white/70 rounded-full animate-bounce [animation-delay:-0.15s]"></span>
<span className="w-1.5 h-1.5 bg-white/70 rounded-full animate-bounce"></span>
</div>
</div>
</motion.div>
)}
</AnimatePresence>
)
}