{product.countInStock === 0 ? (
<button type=”button” disabled className=”btn btn-light”>
Out OF Stock
</button>
) : (
<button
type=”button”
onClick={() => addToCartHandler(product)}
className=”btn btn-warning”
>
Add to cart
</button>
)}
Bassir Answered question October 13, 2022