Spaces:
Running
Running
Download frontend/components/ChatWindow/TypingIndicator.tsx from axeronis/microfunnel-api: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/frontend/components/ChatWindow/TypingIndicator.tsx
- Command line
-
hf download hf://spaces/axeronis/microfunnel-api/frontend/components/ChatWindow/TypingIndicator.tsx
-
curl -L -o TypingIndicator.tsx https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/frontend/components/ChatWindow/TypingIndicator.tsx
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> | |
| ) | |
| } | |