import { Icon } from "../Icon"; type StepStatus = "pending" | "running" | "completed" | "error"; interface ThinkingCardProps { title: string; overview: string; steps: Array<{ id: number; title: string; description: string; status: StepStatus; sub_steps: Array<{ id: string; description: string; status: StepStatus; }>; }>; currentStep: number; isComplete: boolean; } function statusIcon(status: StepStatus) { switch (status) { case "running": return ; case "completed": return ; case "error": return ; default: return ; } } function miniIcon(status: StepStatus) { switch (status) { case "running": return ; case "completed": return ; case "error": return ; default: return ; } } function tone(status: StepStatus) { switch (status) { case "running": return "border-amber-500/20 bg-amber-500/10 text-amber-300"; case "completed": return "border-emerald-500/20 bg-emerald-500/10 text-emerald-300"; case "error": return "border-rose-500/20 bg-rose-500/10 text-rose-300"; default: return "border-zinc-800 bg-zinc-900 text-zinc-400"; } } export default function ThinkingCard({ title, overview, steps, currentStep, isComplete }: ThinkingCardProps) { const completedCount = steps.filter((step) => step.status === "completed").length; const progress = isComplete || steps.length === 0 ? 100 : Math.round((completedCount / steps.length) * 100); const activeLabel = isComplete ? "Plano de Execução" : "Thinking..."; return ( {activeLabel} Agentic mode {title} {overview} Progress {progress}% {steps.length} steps {isComplete ? "Completed" : `Step ${currentStep}`} {steps.map((step, index) => { const isActive = step.id === currentStep || step.status === "running"; const isDone = step.status === "completed"; return ( {index !== steps.length - 1 ? : null} {statusIcon(step.status)} Step {step.id} {step.title} {step.description} {step.status} {step.sub_steps.length > 0 ? ( {step.sub_steps.map((subStep) => ( {miniIcon(subStep.status)} {subStep.id} {subStep.description} {subStep.status} ))} ) : null} ); })} ); }
{overview}
{step.description}