Increase the size of table in Projects Directory and show text in center and add 200 px height.

This commit is contained in:
Kartik sharma 2025-07-09 16:06:30 +05:30
parent e3417287d3
commit bae48be2b5

View File

@ -361,33 +361,36 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
</div> </div>
</div> </div>
<div className="card-minHeight mt-0"> <div className="card-minHeight mt-0">
{/* Loader when switching between Active/Pending or filtering */} {/* LIST VIEW */}
{loading && ( {viewType === "list" && (
<div className="d-flex justify-content-center align-items-center py-5"> <div className="card cursor-pointer mt-3">
<div className="spinner-border text-primary" role="status"> <div className="card-body p-2 pb-1" style={{ minHeight: "200px" }}>
<span className="visually-hidden">Loading...</span>
</div>
</div>
)}
{/* Empty state messages */}
{!loading && (viewType === "card" || viewType === "list") && (
<div className="d-flex flex-column justify-content-center align-items-center text-center">
{contacts?.length === 0 && (
<p className="mt-10">No contact found</p>
)}
{contacts?.length > 0 && currentItems.length === 0 && (
<p className="mt-10">No matching contact found</p>
)}
</div>
)}
{/* List View */}
{!loading && viewType === "list" && currentItems.length > 0 && (
<div className="card cursor-pointer mt-5">
<div className="card-body p-2 pb-1">
<DirectoryListTableHeader> <DirectoryListTableHeader>
{currentItems.map((contact) => ( {!loading && contacts?.length === 0 ? (
<tr>
<td colSpan="6">
<div
className="d-flex justify-content-center align-items-center"
style={{ height: "150px",marginLeft: "230px" }}
>
<p className="mb-0 text-muted">No contact found</p>
</div>
</td>
</tr>
) : !loading && contacts?.length > 0 && currentItems.length === 0 ? (
<tr>
<td colSpan="6">
<div
className="d-flex justify-content-center align-items-center"
style={{ height: "150px" }}
>
<p className="mb-0 text-muted">No matching contact found</p>
</div>
</td>
</tr>
) : (
!loading &&
currentItems.map((contact) => (
<ListViewDirectory <ListViewDirectory
key={contact.id} key={contact.id}
IsActive={IsActive} IsActive={IsActive}
@ -399,14 +402,31 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
IsDeleted={setDeleteContact} IsDeleted={setDeleteContact}
restore={handleDeleteContact} restore={handleDeleteContact}
/> />
))} ))
)}
</DirectoryListTableHeader> </DirectoryListTableHeader>
</div> </div>
</div> </div>
)} )}
{/* Card View */} {/* CARD VIEW */}
{!loading && viewType === "card" && currentItems.length > 0 && ( {viewType === "card" && (
<>
{contacts?.length === 0 && !loading ? (
<div
className="d-flex justify-content-center align-items-center text-center"
style={{ minHeight: "200px" }}
>
<p className="text-muted mb-0">No contact found</p>
</div>
) : currentItems.length === 0 && !loading ? (
<div
className="d-flex justify-content-center align-items-center text-center"
style={{ minHeight: "250px" }}
>
<p className="text-muted mb-0">No matching contact found</p>
</div>
) : (
<div className="row mt-4"> <div className="row mt-4">
{currentItems.map((contact) => ( {currentItems.map((contact) => (
<div <div
@ -427,9 +447,11 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
))} ))}
</div> </div>
)} )}
</>
)}
{/* Notes View */} {/* NOTES VIEW */}
{!loading && viewType === "notes" && ( {viewType === "notes" && (
<div className="mt-0"> <div className="mt-0">
<NotesCardViewDirectory <NotesCardViewDirectory
notes={notes} notes={notes}
@ -441,11 +463,11 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
</div> </div>
)} )}
{/* Pagination */} {/* PAGINATION */}
{!loading && {!loading &&
viewType !== "notes" && viewType !== "notes" &&
contacts?.length > 0 && contacts?.length > 0 &&
filteredContacts.length > ITEMS_PER_PAGE && ( currentItems.length > ITEMS_PER_PAGE && (
<nav aria-label="Page navigation"> <nav aria-label="Page navigation">
<ul className="pagination pagination-sm justify-content-end py-1"> <ul className="pagination pagination-sm justify-content-end py-1">
<li className={`page-item ${currentPage === 1 ? "disabled" : ""}`}> <li className={`page-item ${currentPage === 1 ? "disabled" : ""}`}>
@ -493,4 +515,3 @@ const Directory = ({ IsPage = true, prefernceContacts }) => {
}; };
export default Directory; export default Directory;