summaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-25 17:53:24 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-25 17:53:24 -0600
commit07ca16f41c53eccf4a9b959bd4e4656a987d8199 (patch)
tree471e27a49c77fcaa5323678dcfa3db3960387505 /src/routes
parent31cc5ecdb693be1da04ee0a3e6dc876535d5fb4b (diff)
Añade listado de productos
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/products/products.tsx12
1 files changed, 10 insertions, 2 deletions
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>
</>
);