From 4a2a65a97b9fa04544f4910ee9c9b5425969ea7c Mon Sep 17 00:00:00 2001 From: kleap-admin Date: Sun, 18 Jan 2026 18:28:42 +0000 Subject: [PATCH] Update app/products/page.tsx --- app/products/page.tsx | 90 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 app/products/page.tsx diff --git a/app/products/page.tsx b/app/products/page.tsx new file mode 100644 index 0000000..2321d70 --- /dev/null +++ b/app/products/page.tsx @@ -0,0 +1,90 @@ +"use client"; +import { useState } from "react"; +import { Container } from "@/components/container"; +import { Heading } from "@/components/heading"; +import { products, categories } from "@/lib/data"; +import { ProductCard } from "@/components/product-card"; +import { Footer } from "@/components/footer"; +import { Input } from "@/components/ui/input"; +import { Search, SlidersHorizontal } from "lucide-react"; + +export default function ProductsPage() { + const [searchQuery, setSearchQuery] = useState(""); + const [selectedCategory, setSelectedCategory] = useState("All"); + + const filteredProducts = products.filter((p) => { + const matchesSearch = p.name.toLowerCase().includes(searchQuery.toLowerCase()); + const matchesCategory = selectedCategory === "All" || p.category === selectedCategory; + return matchesSearch && matchesCategory; + }); + + return ( +
+
+ + Our Products +
+
+ + setSearchQuery(e.target.value)} + /> +
+
+ + {categories.map((cat) => ( + + ))} +
+
+
+
+ +
+ +
+

+ Showing {filteredProducts.length} products +

+
+ + {filteredProducts.length > 0 ? ( +
+ {filteredProducts.map((product) => ( + + ))} +
+ ) : ( +
+ No products found +

Try adjusting your search or filters

+
+ )} +
+
+
+ ); +}