"use client"; import { motion } from "framer-motion"; import { CheckCircle2, CircleDashed, XCircle, AlertCircle, Play, FileCode2 } from "lucide-react"; export interface PlanStep { id: string; description: string; filesData?: string[]; status: "pending" | "running" | "done" | "error"; error?: string; } interface PlanViewProps { steps: PlanStep[]; goal: string; onExecute: () => void; isExecuting: boolean; onExecuteStep: (id: string) => void; } export function PlanView({ steps, goal, onExecute, isExecuting, onExecuteStep }: PlanViewProps) { const getIcon = (status: string) => { switch (status) { case "done": return ; case "running": return ; case "error": return ; default: return ; } }; if (!steps.length) return null; const total = steps.length; const done = steps.filter(s => s.status === "done").length; const progress = Math.round((done / total) * 100); return (
{/* Header */}

Implementation Plan

{done} / {total}

{goal}

{/* Progress bar */}
{/* Steps checklist */}
{steps.map((step, i) => (
{getIcon(step.status)}

Step {i + 1}: {step.description}

{step.filesData && step.filesData.length > 0 && (
{step.filesData.map((f, j) => ( {f} ))}
)} {step.error && (

{step.error}

)}
{(step.status === "pending" || step.status === "error") && !isExecuting && ( )}
))}
{/* Global Actions */} {!isExecuting && done < total && ( )} {done === total && total > 0 && (
Plan execution complete
)}
); }