// DocumentPanel.jsx import { useRef, forwardRef, useImperativeHandle } from 'react' const DocumentPanel = forwardRef(function DocumentPanel({ text, documentType, onDocumentChange, onDocumentTypeChange, onStartAnalysis, onDownload, onClear, loading, sessionId, }, ref) { const textareaRef = useRef(null) useImperativeHandle(ref, () => ({ focus() { textareaRef.current?.scrollIntoView({ behavior: 'smooth' }) setTimeout(() => textareaRef.current?.focus(), 400) } })) function handleFileUpload(e) { const file = e.target.files[0] if (!file) return const reader = new FileReader() reader.onload = (ev) => onDocumentChange(ev.target.result) reader.readAsText(file) e.target.value = '' } return (
Dokument
Dokumenttyp