import { useEffect, useState } from "react" import { useTranslation } from "react-i18next" export function TypingIndicator() { const { t } = useTranslation() const thinkingSteps = [ t("chat.thinking.step1"), t("chat.thinking.step2"), t("chat.thinking.step3"), t("chat.thinking.step4"), ] const [stepIndex, setStepIndex] = useState(0) useEffect(() => { const stepsCount = thinkingSteps.length const interval = setInterval(() => { setStepIndex((prev) => (prev + 1) % stepsCount) }, 3000) return () => clearInterval(interval) }, [thinkingSteps.length]) return (
{thinkingSteps[stepIndex]}