import { useDropzone } from "react-dropzone"; import { uploadDoc } from "../lib/fetchers"; function DocReceiver({ handleReceiveText }: { handleReceiveText: (content: string) => void, }) { function onDrop(files: File[]) { uploadDoc(files[0], { start: () => null, error: () => null, progress: () => null, complete: (m: string) => { handleReceiveText(m); } }) } const {getRootProps, getInputProps, isDragActive} = useDropzone({ onDrop, multiple: false, // accept: [".doc", ".docx", ".md", ".txt", "text/*", ""], }); return