import React from 'react'
const Cart = ({ show, onHide, cart, onUpdateQuantity, onRemoveFromCart, totalPrice }) => {
return (
<>
{show &&
Shopping Cart
{cart.length === 0 ? (
Your cart is empty
) : (
cart.map(item => (
{item.title}
${item.price}
{item.quantity}
))
)}
{cart.length > 0 && (
Total: ${totalPrice.toFixed(2)}
)}
>
)
}
export default Cart