summaryrefslogtreecommitdiff
path: root/src/routes/products
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/products')
-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>
</>
);