OwlCyberSecurity - MANAGER
Edit File: AddToAmazonBasketButton.tsx
"use client"; import { addToAmazonBasket } from "@/redux/features/amazonBasketSlice"; import React from "react"; import { useDispatch } from "react-redux"; function AddToAmazonBasketButton({ link, weight_unit, firstweight, singleitemfullprice, exchange_id, region_id, image, name, cost, buyCost, buyProfit, shipBroker, asin, id, }: any) { const dispatch = useDispatch(); function addItemToAmazonBasket() { const amazonProduct = { link, weight_unit, firstweight, singleitemfullprice, exchange_id, region_id, image, name, cost, buyCost, buyProfit, shipBroker, asin, id, }; dispatch(addToAmazonBasket(amazonProduct)); } return ( <button onClick={addItemToAmazonBasket} className="add-amazon-basket-button" > <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor" className="w-6 h-6" > <path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15" /> </svg> <p>افزودن به سبد خرید</p> {/* <p>{asin}</p> */} </button> ); } export default AddToAmazonBasketButton;