CartSummary.jsx

jsx1 kB19 linesIn React_Labs_Chapters_05_07.zip

React_Labs_Chapters_05_07.ziplab2-templatesrccomponentsCartSummary.jsx

JSX
import React from 'react';

// TODO: Complete this component
// 1. Accept props: { count, total, onCheckout }
// 2. Display cart count and total price
// 3. Add "Checkout" button that calls onCheckout when clicked
// 4. Use preventDefault in form submission if using a form

function CartSummary() {
  return (
    <div className="cart-summary card">
      {/* TODO: Display cart count and total */}
      {/* TODO: Add checkout button with onClick handler */}
    </div>
  );
}

export default CartSummary;

In components/