'use client' import { useCallback, useState } from 'react' import { motion, Reorder, useDragControls } from 'framer-motion' import { Plus, Trash2, GripVertical, ChevronDown, ChevronUp } from 'lucide-react' import { nanoid } from 'nanoid' import type { GeneratorSection } from '@/types' interface SectionEditorProps { sections: GeneratorSection[] onChange: (sections: GeneratorSection[]) => void } interface SectionItemProps { section: GeneratorSection onUpdate: (id: string, updates: Partial) => void onDelete: (id: string) => void } function SectionItem({ section, onUpdate, onDelete }: SectionItemProps) { const [isExpanded, setIsExpanded] = useState(true) const dragControls = useDragControls() return ( {/* Section Header */}
onUpdate(section.id, { title: e.target.value })} placeholder="Section Title" className="flex-1 bg-transparent border-none text-white font-medium focus:outline-none placeholder-neutral-500" />
{/* Section Content */} {isExpanded && (