From 3132c1fa3c3a44d0925198ae67651cb009861a58 Mon Sep 17 00:00:00 2001
From: Michael Irwin
Date: Mon, 23 Dec 2024 16:19:58 -0500
Subject: [PATCH] Add empty text to webapp when no products exist in the
catalog
---
dev/webapp/src/App.jsx | 48 ++++++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 21 deletions(-)
diff --git a/dev/webapp/src/App.jsx b/dev/webapp/src/App.jsx
index cbb3b5f..1321b12 100644
--- a/dev/webapp/src/App.jsx
+++ b/dev/webapp/src/App.jsx
@@ -49,27 +49,33 @@ function App() {
{catalog ? (
-
-
-
- ID |
- Name |
- Price |
- UPC |
- Inventory |
- Image |
-
-
-
- {catalog.map((product) => (
- fetchCatalog()}
- />
- ))}
-
-
+ <>
+ {catalog.length === 0 ? (
+ There are no products... yet!
+ ) : (
+
+
+
+ ID |
+ Name |
+ Price |
+ UPC |
+ Inventory |
+ Image |
+
+
+
+ {catalog.map((product) => (
+ fetchCatalog()}
+ />
+ ))}
+
+
+ )}
+ >
) : (
Loading catalog...
)}