'use client'; import { useEffect, useState } from 'react'; interface SearchLoadingAnimationProps { currentSource?: string; checkedSources?: number; totalSources?: number; } export function SearchLoadingAnimation({ currentSource, checkedSources = 0, totalSources = 16, }: SearchLoadingAnimationProps) { const [dots, setDots] = useState(''); useEffect(() => { const dotInterval = setInterval(() => { setDots((prev) => (prev.length >= 3 ? '' : prev + '.')); }, 500); return () => clearInterval(dotInterval); }, []); // Calculate progress (0-100%) const progress = totalSources > 0 ? (checkedSources / totalSources) * 100 : 0; const statusText = `${checkedSources}/${totalSources} 个源`; return (