import React from 'react' import { useDispatch } from 'react-redux' import * as Icon from 'react-feather' const QtyForm = ({ id, quantity}) => { const dispatch = useDispatch() const addQuantity = (pId) => { dispatch({ type: 'ADD_QUANTITY', id: pId }) } const subQuantity = (pId) => { dispatch({ type: 'SUB_QUANTITY', id: pId }) } return (
{ e.preventDefault(); subQuantity(id); }} > (e)} /> { e.preventDefault(); addQuantity(id); }}>
) } export default QtyForm