From 435a576c15ffa9acc346d6b8598bfa4f9a823bd8 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Sat, 11 Mar 2023 00:00:23 +0800 Subject: [PATCH] Polished products page search --- src/Components/ProductsPage/ViewManager.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Components/ProductsPage/ViewManager.tsx b/src/Components/ProductsPage/ViewManager.tsx index 725bb1a..d9de4a5 100644 --- a/src/Components/ProductsPage/ViewManager.tsx +++ b/src/Components/ProductsPage/ViewManager.tsx @@ -54,8 +54,11 @@ export default function ViewManager(props: ProductList) { - Product.name.toLowerCase().includes(searchTerm) + Products={props.Products.filter( + (Product) => + Product.name.toLowerCase().includes(searchTerm) || + Product.date_added.toLowerCase().includes(searchTerm) || + Product.id.toString().includes(searchTerm) )} />