import { useState } from 'react'; import ReactMarkdown from 'react-markdown'; import { Badge } from './ui/badge'; import { Button } from './ui/button'; import { X, Send } from 'lucide-react'; export function PlanMode({ input, onApprove, onApproveYolo, onReject, onSendFeedback }: { input: any; onApprove: () => void; onApproveYolo?: () => void; onReject: (feedback: string) => void; onSendFeedback?: (feedback: string) => void; }) { const [showFull, setShowFull] = useState(false); const [feedback, setFeedback] = useState(''); const planText = input?.plan || input?.content || input?.text || ''; const truncated = planText.length > 500 ? planText.slice(0, 500) + '...' : planText; const feedbackInput = (
setFeedback(e.target.value)} placeholder="Feedback..." className="flex-1 bg-bg border border-border rounded-md px-3 py-2 text-text text-sm focus:outline-none focus:border-accent" /> {onSendFeedback && ( )}
); const controls = (
{onApproveYolo && ( )}
); if (showFull) { return (
PLAN
{planText}
{feedbackInput} {controls}
); } return (
PLAN
{truncated}
{feedbackInput} {controls}
); }