diff --git a/src/components/DocumentList.tsx b/src/components/DocumentList.tsx index 73a6db4..272f2f3 100644 --- a/src/components/DocumentList.tsx +++ b/src/components/DocumentList.tsx @@ -5,7 +5,7 @@ import { Transition, TransitionChild, DialogPanel, DialogTitle } from '@headless import { Fragment, useState } from 'react'; export function DocumentList() { - const { documents, removeDocument, isLoading, error } = usePDF(); + const { documents, removeDocument, isLoading } = usePDF(); const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false); const [documentToDelete, setDocumentToDelete] = useState<{ id: string; name: string } | null>(null); @@ -29,14 +29,6 @@ export function DocumentList() { ); } - if (error) { - return ( -
- {error} -
- ); - } - if (documents.length === 0) { return (
diff --git a/src/components/PDFUploader.tsx b/src/components/PDFUploader.tsx index 35d95ab..4903abf 100644 --- a/src/components/PDFUploader.tsx +++ b/src/components/PDFUploader.tsx @@ -9,7 +9,7 @@ interface PDFUploaderProps { } export function PDFUploader({ className = '' }: PDFUploaderProps) { - const { addDocument, error: contextError } = usePDF(); + const { addDocument } = usePDF(); const [isUploading, setIsUploading] = useState(false); const [error, setError] = useState(null); @@ -21,13 +21,13 @@ export function PDFUploader({ className = '' }: PDFUploaderProps) { try { await addDocument(file); } catch (err) { - setError(contextError || 'Failed to upload PDF. Please try again.'); + setError('Failed to upload PDF. Please try again.'); console.error('Upload error:', err); } finally { setIsUploading(false); } } - }, [addDocument, contextError]); + }, [addDocument]); const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop,