I'm making Shopping Cart, and I need to show all elements which were added to Shopping Cart, but elements which are the same should appear in the list only 1 time , but in this case i need to show quantity of these elements...
{shoppingCart.map((book) => (
<div key={book.id} className="book-element">
<div className="col-1">
<img src={book.image}/>
</div>
<div className="col-4 shp-description">
<p>{book.title}</p>
<p>Cover: {book.hardCover === false ? 'Paperback' : 'Hardcover'}</p>
</div>
<div className="col-2">{}</div> // here i need to set quantity of the same elements
<div className="col-2">{book.price}$</div>
<div className="col-1">
<i className="fa fa-times" aria-hidden="true"></i>
</div>
</div>
))}