import { useRef, useState } from "react"; import { IconUpload } from "../lib/icons"; // Premium drag-and-drop upload zone. Validation + states live in the parent; // this just surfaces the file and the drag affordance. export default function Upload({ onFile, uploading }) { const [drag, setDrag] = useState(false); const inputRef = useRef(null); function handleFiles(files) { const file = files?.[0]; if (file) onFile(file); } return (
or click to browse · PDF or TXT · up to 10 MB
{ handleFiles(e.target.files); e.target.value = ""; }} />