diff --git a/src/app/paperless/document/[id]/page.tsx b/src/app/paperless/document/[id]/page.tsx index 89eec4f..71f8717 100644 --- a/src/app/paperless/document/[id]/page.tsx +++ b/src/app/paperless/document/[id]/page.tsx @@ -5,5 +5,9 @@ export default function ModalDocumentPage({ }: { params: { id: number }; }) { - return ; + return ( +
+ +
+ ); } diff --git a/src/components/document-viewer.tsx b/src/components/document-viewer.tsx index c84d51e..3fb19c6 100644 --- a/src/components/document-viewer.tsx +++ b/src/components/document-viewer.tsx @@ -41,6 +41,29 @@ export default function DocumentViewer(props: { id: number }) { const [pdfUrl, setPdfUrl] = useState(null); const [loading, setLoading] = useState(true); + const SkeletonLoader = () => ( +
+
+
+
+ {/* PDF Skeleton */} +
+ {/* Button Skeleton */} +
+
+
+
+
+
+
+
+
+
+
+
+
+ ); + useEffect(() => { const fetchData = async () => { setLoading(true); @@ -65,15 +88,7 @@ export default function DocumentViewer(props: { id: number }) { }, [props.id]); // Dependency array to refetch if id changes if (loading) { - return ( -
-
- - Loading... - -
-
- ); + return ; } if (!pdfUrl) { @@ -81,7 +96,7 @@ export default function DocumentViewer(props: { id: number }) { } return ( -
+