import { Search, BookOpen, Brain, Loader2, CheckCircle2 } from 'lucide-react'; import { cn } from '@/lib/utils'; export type ThinkingStep = | 'analyzing' | 'planning' | 'searching' | 'reading' | 'validating' | 'formulating' | 'complete'; interface ThinkingIndicatorProps { currentStep: ThinkingStep; searchQuery?: string; sourcesRead?: number; totalSources?: number; planSize?: number; onComplete?: () => void; } export function ThinkingIndicator({ currentStep, searchQuery, sourcesRead = 0, totalSources = 0, planSize = 0, }: ThinkingIndicatorProps) { const steps: Array<{ key: ThinkingStep; label: string; icon: React.ReactNode; }> = [ { key: 'analyzing', label: 'Analisando...', icon: , }, { key: 'planning', label: 'Planejando pesquisa...', icon: , }, { key: 'searching', label: planSize > 0 ? `Pesquisando (${planSize} tópicos)...` : 'Pesquisando na web...', icon: , }, { key: 'reading', label: 'Lendo conteúdo...', icon: , }, { key: 'validating', label: 'Validando dados...', icon: , }, { key: 'formulating', label: 'Formulando resposta...', icon: , }, ]; const currentStepIndex = steps.findIndex(s => s.key === currentStep); const isComplete = currentStep === 'complete'; if (isComplete) { return null; // Não mostrar quando completo } return (
{steps.slice(0, currentStepIndex + 1).map((step, idx) => { const isActive = idx === currentStepIndex; const isPast = idx < currentStepIndex; return (
{isPast ? ( ) : isActive ? ( ) : ( step.icon )}
{step.label} {idx < steps.length - 1 && (
)}
); })}
); }