import { TextEditor } from '@/features/compose/text-editor';
import type { PendingAttachment } from '@/features/compose/attachment-strip';

interface TextComposeStepProps {
  textContent: string;
  onTextChange: (text: string) => void;
  onAdvance: () => void;
  onCancel: () => void;
  attachments: PendingAttachment[];
  onRemoveAttachment: (id: string) => void;
  onAddFiles: () => void;
  isDragging: boolean;
  dropZoneProps: {
    onDragOver: (e: React.DragEvent) => void;
    onDragEnter: (e: React.DragEvent) => void;
    onDragLeave: (e: React.DragEvent) => void;
    onDrop: (e: React.DragEvent) => void;
  };
}

export function TextComposeStep({
  textContent,
  onTextChange,
  onAdvance,
  onCancel,
  attachments,
  onRemoveAttachment,
  onAddFiles,
  isDragging,
  dropZoneProps,
}: TextComposeStepProps) {
  return (
    <TextEditor
      textContent={textContent}
      onTextChange={onTextChange}
      onSubmit={onAdvance}
      onCancel={onCancel}
      submitHint="next"
      attachmentProps={{
        attachments,
        onRemoveAttachment,
        onAddFiles,
        isDragging,
        dropZoneProps,
      }}
    />
  );
}
