"use client"; import CardCart from "@comp/Cards/CardCart/page"; import CardNormal from "@comp/Cards/CardNormal/page"; import NavBarDownCart from "@comp/Carts/component/NavBarDownCart/page"; import Navbar from "@comp/Navbar/page"; import AppContext from "@ctx/AppContext"; import { useRouter } from "next/navigation"; import Chapar from "plugins/Chapar"; import PersianNumber from "plugins/PersianNumber"; import { useContext, useEffect } from "react"; import { toast } from "react-toastify"; import { Swiper, SwiperSlide } from "swiper/react"; const CartData = ({ data }) => { const CTX = useContext(AppContext); const router = useRouter(); const cart = CTX.state.cart; const calculateTotalCost = cart.reduce( (total, item) => total + parseInt(item.cost) * item.count, 0 ); const calculateTotalCostWithDiscount = cart.reduce( (total, item) => total + parseInt(item.costWithDiscount) * item.count, 0 ); const handleGoCheckOut = async () => { CTX.GoCheckOut(); }; useEffect(() => { CTX.setBottomSheetCartOpen(false); }, []); return ( <>

محصولات انتخاب شده

محصول

{cart?.map((e, index) => ( ))}
{" "}

سبد خریدتو کامل کن{" "} (فقط امروز)

console.log("slide change")} className="rtl relative" // dir="rtl" breakpoints={{ 320: { slidesPerView: 1.8, }, 480: { slidesPerView: 2.1, }, 768: { slidesPerView: 2.2, }, 1024: { slidesPerView: 3.3, }, 1440: { slidesPerView: 2.8, }, }} > {data?.map((e, index) => ( ))}
{/*

برای رسیدن به الماس باید پنح خرید دیگر انجام دهید

*/}

حساب نهایی

{/*

محصول

*/}

قیمت

{" "} تومان

تخفیف محصول

{" "} تومان

قابل پرداخت

{" "} تومان
handleGoCheckOut()} permissionGoPay={!!cart.length > 0} />
); }; export default CartData;