"use client"; import { useState, useRef, useCallback } from "react"; export default function UploadArea({ onUpload, loading }) { const [dragOver, setDragOver] = useState(false); const inputRef = useRef(null); const handleFile = useCallback( (file) => { if (!file) return; if ( !file.name.endsWith(".docx") && file.type !== "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ) { alert("Please upload a .docx file"); return; } onUpload(file); }, [onUpload] ); const onDrop = useCallback( (e) => { e.preventDefault(); setDragOver(false); const file = e.dataTransfer.files[0]; handleFile(file); }, [handleFile] ); const onDragOver = useCallback((e) => { e.preventDefault(); setDragOver(true); }, []); const onDragLeave = useCallback(() => { setDragOver(false); }, []); return (
Upload a .docx SOP document and let AI automatically detect headings that are formatted like body text. The enricher will increase their font size so your parser can reliably identify sections.
Drop your .docx file here, or click to browse
Supports .docx files only
How it works: