{ "name": "ai-text-loading", "type": "registry:component", "dependencies": [ "motion" ], "files": [ { "type": "registry:component", "content": "\"use client\";\n\n/**\n * @author: @kokonutui\n * @description: AI Text Loading\n * @version: 1.0.0\n * @date: 2025-06-26\n * @license: MIT\n * @website: https://kokonutui.com\n * @github: https://github.com/kokonut-labs/kokonutui\n */\n\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { useEffect, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface AITextLoadingProps {\n texts?: string[];\n className?: string;\n interval?: number;\n}\n\nexport default function AITextLoading({\n texts = [\n \"Thinking...\",\n \"Processing...\",\n \"Analyzing...\",\n \"Computing...\",\n \"Almost...\",\n ],\n className,\n interval = 1500,\n}: AITextLoadingProps) {\n const [currentTextIndex, setCurrentTextIndex] = useState(0);\n\n useEffect(() => {\n const timer = setInterval(() => {\n setCurrentTextIndex((prevIndex) => (prevIndex + 1) % texts.length);\n }, interval);\n\n return () => clearInterval(timer);\n }, [interval, texts.length]);\n\n return (\n