diff --git a/src/components/Documents/DocumentSkeleton.jsx b/src/components/Documents/DocumentSkeleton.jsx new file mode 100644 index 00000000..af75fd01 --- /dev/null +++ b/src/components/Documents/DocumentSkeleton.jsx @@ -0,0 +1,70 @@ +import React from "react"; + +const SkeletonCell = ({ + width = "100%", + height = 20, + className = "", + style = {}, +}) => ( +
+); + +export const DocumentTableSkeleton = ({ rows = 5 }) => { + return ( +
+ + + + + + + + + + + + + {[...Array(rows)].map((_, idx) => ( + + {/* Name */} + + + {/* Document Type */} + + + {/* Uploaded By (Avatar + Name) */} + + + {/* Uploaded on */} + + + {/* Status */} + + + ))} + +
NameDocument TypeUploaded ByUploaded onStatus
+ + + + +
+ + +
+
+ + + +
+
+ ); +}; diff --git a/src/components/Documents/DocumentsList.jsx b/src/components/Documents/DocumentsList.jsx index 11bbb649..aef0c14c 100644 --- a/src/components/Documents/DocumentsList.jsx +++ b/src/components/Documents/DocumentsList.jsx @@ -5,6 +5,7 @@ import Avatar from "../common/Avatar"; import { formatUTCToLocalTime } from "../../utils/dateUtils"; import Loader from "../common/Loader"; import { useDebounce } from "../../utils/appUtils"; +import { DocumentTableSkeleton } from "./DocumentSkeleton"; export const getDocuementsStatus = (status) => { switch (status) { @@ -43,7 +44,7 @@ const DocumentsList = ({ Document_Entity, Entity,searchText ,setIsRefetching, setIsRefetching(isFetching); }, [isFetching, setIsRefetching]); - if (isLoading) return ; + if (isLoading) return ; if (isError) return

Error: {error?.message || "Something went wrong"}

; const DocumentColumns = [ diff --git a/src/components/Documents/NewDocument.jsx b/src/components/Documents/NewDocument.jsx index 180ee24e..df94bab4 100644 --- a/src/components/Documents/NewDocument.jsx +++ b/src/components/Documents/NewDocument.jsx @@ -174,7 +174,7 @@ const NewDocument = ({closeModal,Document_Entity,Entity}) => {
{/* Type */} -
+ {categoryId && (