"use client"; import { CheckCircle, ChevronDown, Sparkles, Circle, Check, } from "lucide-react"; import { useState } from "react"; import { cn } from "@/lib/utils"; import { Button } from "../ui/button"; import { Badge } from "../ui/badge"; import { HumanResponse } from "@langchain/langgraph/prebuilt"; type PlanItem = { index: number; plan: string; completed: boolean; }; type AcceptedPlanStepProps = { planTitle?: string; planItems?: PlanItem[]; interruptType?: HumanResponse["type"]; collapse?: boolean; }; export function AcceptedPlanStep({ planTitle, planItems = [], interruptType, collapse: collapseProp = true, }: AcceptedPlanStepProps) { const [collapsed, setCollapsed] = useState(collapseProp); const getStatusText = () => { if (interruptType === "edit") { return "Plan revised and approved"; } return "Plan approved and ready"; }; const getStatusBadge = () => { return ( Approved ); }; const getPlanItemIcon = (item: PlanItem) => { if (item.completed) { return (
); } return (
); }; const totalCount = planItems.length; return (
{/* Header */}

{getStatusText()}

{getStatusBadge()}
{totalCount > 0 && (

{totalCount} steps

)}
{/* Content */}
{planTitle && (

Plan Overview

{planTitle}

)} {planItems.length > 0 && (

Execution Steps {totalCount}

{planItems .sort((a, b) => a.index - b.index) .map((item, idx) => (
{getPlanItemIcon(item)}

{item.plan}

{idx + 1}
))}
)}
); }