import { useEffect, useState } from "react"; import { Loader2, RotateCcw } from "lucide-react"; import { useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; interface ThreadHistoryStatusProps { loading: boolean; error: string | null; pullDistance?: number; onRetry: () => void; } export function ThreadHistoryStatus({ loading, error, onRetry, pullDistance = 0 }: ThreadHistoryStatusProps) { const { t } = useTranslation(); const [showLoading, setShowLoading] = useState(false); useEffect(() => { if (!loading) { setShowLoading(false); return; } const timer = window.setTimeout(() => setShowLoading(true), 180); return () => window.clearTimeout(timer); }, [loading]); return (