ProductCard.jsx

jsx1 kB19 linesIn React_Labs_Chapters_05_07.zip

React_Labs_Chapters_05_07.ziplab2-templatesrccomponentsProductCard.jsx

JSX
import React from 'react';

// TODO: Complete this component
// 1. Accept props using destructuring: { id, name, price, description, image, onAddToCart }
// 2. Format price as currency (e.g., $999.99)
// 3. Add "Add to Cart" button that calls onAddToCart(id) when clicked
// 4. Use appropriate CSS classes from lab-theme.css

function ProductCard() {
  return (
    <div className="product-card">
      {/* TODO: Display product image, name, description, price */}
      {/* TODO: Add button with onClick handler */}
    </div>
  );
}

export default ProductCard;

In components/