diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2022-11-11 18:02:11 +0700 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2022-11-11 18:02:11 +0700 |
| commit | 8ee5432961a5b73e8e5c42af2eda05621723c9e7 (patch) | |
| tree | 12b7e0628328f6f10f03b464ad0717a729e2ede0 /src/components/ProductCard.js | |
| parent | df04a3504e61f3c1257b5a46310e39c51bf23bea (diff) | |
Connect to solr (search product), header component with title, fix product card layout, show product search result
Diffstat (limited to 'src/components/ProductCard.js')
| -rw-r--r-- | src/components/ProductCard.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/components/ProductCard.js b/src/components/ProductCard.js index 360e11ff..49bba235 100644 --- a/src/components/ProductCard.js +++ b/src/components/ProductCard.js @@ -24,19 +24,25 @@ export default function ProductCard({ data }) { {product.name} </Link> </div> - <div> + <div className="flex-1 mt-2"> {product.lowest_price.discount_percentage > 0 ? ( - <div className="flex gap-x-1 items-center mt-2"> + <div className="flex gap-x-1 items-center"> <span className="badge-yellow">{product.lowest_price.discount_percentage}%</span> <p className="text-xs text-gray-800 line-through">{currencyFormat(product.lowest_price.price)}</p> </div> ) : ''} - <p className="text-sm text-gray-900 font-semibold">{product.lowest_price.price_discount > 0 ? currencyFormat(product.lowest_price.price_discount) : 'Tanya harga'}</p> - {product.stock_total > 0 ? ( - <div className="badge-yellow bg-green-200 text-green-700 w-fit mt-2">Ready Stock</div> + {product.lowest_price.price_discount > 0 ? ( + <p className="text-sm text-gray-900 font-semibold"> + {currencyFormat(product.lowest_price.price_discount)} + </p> ) : ( - <div className="h-6"></div> + <a href="https://wa.me" className="py-2 rounded block text-sm border border-yellow-900 text-center"> + Tanya Harga + </a> )} + {product.stock_total > 0 ? ( + <div className="badge-yellow bg-green-200 text-green-700 w-fit mt-2">Ready Stock</div> + ) : ''} </div> </div> </div> |
