+ {/* LIST VIEW */}
+ {viewType === "list" && (
+
+
- {currentItems.map((contact) => (
-
- ))}
+ {!loading && contacts?.length === 0 ? (
+
+
+
+ |
+
+ ) : !loading && contacts?.length > 0 && currentItems.length === 0 ? (
+
+
+
+ No matching contact found
+
+ |
+
+ ) : (
+ !loading &&
+ currentItems.map((contact) => (
+
+ ))
+ )}
)}
- {/* Card View */}
- {!loading && viewType === "card" && currentItems.length > 0 && (
-
- {currentItems.map((contact) => (
+ {/* CARD VIEW */}
+ {viewType === "card" && (
+ <>
+ {contacts?.length === 0 && !loading ? (
- ))}
-
+ ) : currentItems.length === 0 && !loading ? (
+
+
No matching contact found
+
+ ) : (
+
+ {currentItems.map((contact) => (
+
+
+
+ ))}
+
+ )}
+ >
)}
- {/* Notes View */}
- {!loading && viewType === "notes" && (
+ {/* NOTES VIEW */}
+ {viewType === "notes" && (
{
{!loading &&
viewType !== "notes" &&
contacts?.length > 0 &&
- filteredContacts.length > ITEMS_PER_PAGE && (
+ currentItems.length > ITEMS_PER_PAGE && (