"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 (

Enrich your SOP headings

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.

inputRef.current?.click()} onDrop={onDrop} onDragOver={onDragOver} onDragLeave={onDragLeave} >

Drop your .docx file here, or click to browse

Supports .docx files only

handleFile(e.target.files[0])} disabled={loading} />

How it works:

1. Upload your SOP .docx file
2. AI detects headings automatically
3. Review, adjust, and download
); }