import { useState } from 'react' import { ChevronUp, ChevronDown, AlertTriangle, Clock, ExternalLink, CheckSquare, Terminal, Settings2 } from 'lucide-react' import type { ProceduralStep, StepContentType, IntakeFormField } from '@/types' import { cn } from '@/lib/utils' import { FallbackSteps } from '@/components/procedural/FallbackSteps' const CONTENT_TYPE_OPTIONS: { value: StepContentType; label: string; color: string }[] = [ { value: 'action', label: 'Action', color: 'text-blue-400' }, { value: 'informational', label: 'Info', color: 'text-muted-foreground' }, { value: 'verification', label: 'Verify', color: 'text-emerald-400' }, { value: 'warning', label: 'Warning', color: 'text-yellow-400' }, ] interface StepEditorProps { step: ProceduralStep stepNumber: number onUpdate: (updates: Partial) => void onCollapse: () => void availableVariables: IntakeFormField[] } export function StepEditor({ step, stepNumber, onUpdate, onCollapse, availableVariables }: StepEditorProps) { const [showMore, setShowMore] = useState(false) // Section header steps get a minimal editor if (step.type === 'section_header') { return (
Edit Section Header
onUpdate({ title: e.target.value })} placeholder="Section title" className="w-full rounded border border-border bg-elevated px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-hidden focus:ring-1 focus:ring-primary/20" />
) } return (
{/* Header */}
{stepNumber} Edit Step
{/* Title */}
onUpdate({ title: e.target.value })} className="w-full rounded border border-border bg-elevated px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-hidden focus:ring-1 focus:ring-primary/20" />
{/* Est. Minutes */}
onUpdate({ estimated_minutes: e.target.value ? parseInt(e.target.value) : undefined })} placeholder="—" min={1} className="w-full rounded border border-border bg-elevated px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-hidden focus:ring-1 focus:ring-primary/20" />
{/* Description */}