From 07ca16f41c53eccf4a9b959bd4e4656a987d8199 Mon Sep 17 00:00:00 2001
From: HombreLaser <sebastian-440@live.com>
Date: Tue, 25 Apr 2023 17:53:24 -0600
Subject: Añade listado de productos
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/routes/products/products.tsx | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'src/routes/products/products.tsx')

diff --git a/src/routes/products/products.tsx b/src/routes/products/products.tsx
index 80a9794..c7f3a3a 100644
--- a/src/routes/products/products.tsx
+++ b/src/routes/products/products.tsx
@@ -1,15 +1,23 @@
 import { useLoaderData } from "react-router-dom";
+import ProductListing from "../../components/product_listing";
 import SearchBar from "../../components/search_bar";
 import MainContentLayout from "../../components/main_content_layout";
 
 export default function Products() {
-  const products = useLoaderData();
-  console.log(products);
+  const products = useLoaderData().data;
+  const productList = products.map(product =>
+    <li key={product.id}>
+      <ProductListing product={product}/>
+    </li>
+  );
 
   return(
     <>
       <MainContentLayout>
         <SearchBar path="/products"/>
+        <ul>
+          {productList}
+        </ul>
       </MainContentLayout>
     </>
   );
-- 
cgit v1.2.3

