import { useRef, useState } from 'react'; interface DocumentManagerProps { documents: Array<{ id: string; title: string; filepath: string }>; onUpload: (files: FileList) => void; onPaste: (text: string, filename: string) => void; } function PasteModal({ onClose, onConfirm }: { onClose: () => void; onConfirm: (text: string, filename: string) => void }) { const [text, setText] = useState(''); const [filename, setFilename] = useState('pasted-document.md'); function handleConfirm() { const trimmed = text.trim(); if (!trimmed) return; onConfirm(trimmed, filename.trim() || 'pasted-document.md'); onClose(); } return (
No documents loaded. Upload .md or .txt files, or paste text. They stay local to this browser session.
) : (