* wip * wip * wip * format * wip(mobile): lint and format * cleanup * nits * nits * idiomatic react * nit * format all root files
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
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,
|
|
}}
|
|
/>
|
|
);
|
|
}
|