import React from 'react' import Link from 'next/link' import * as Icon from 'react-feather' import { useSelector, useDispatch } from 'react-redux' import { useToasts } from 'react-toast-notifications' import { useRouter } from 'next/router' import QtyForm from './QtyForm' //library yarn import NumberFormat from 'react-number-format'; const CartContent = function ({ backend, cart_product, ...props }) { const router = useRouter() const { addToast } = useToasts() const dispatch = useDispatch() const cart = useSelector((state) => state.cart) const total = useSelector((state) => state.total) // console.log(cart) const removeItem = () => { dispatch({ type: 'REMOVE_ITEM', id: pId }) addToast('Cart Removed Successfully', { appearance: 'error' }) } const reset = () => { dispatch({ type: 'RESET' }) addToast('Thanks for your order.', { appearance: 'success' }) router.push('/') } return ( <>
| Product | Nama Product | Warna Product | Harga Product | Jumlah | Total |
|---|---|---|---|---|---|
|
|
{data.product_name} | {data.product_color} |
|
|
|
| Tidak Ada Product di Keranjang | |||||