"use client"; import BreadcrumbCart from "@/components/cart-page/BreadcrumbCart"; import ProductCard from "@/components/cart-page/ProductCard"; import { Button } from "@/components/ui/button"; import InputGroup from "@/components/ui/input-group"; import { cn } from "@/lib/utils"; import { integralCF } from "@/styles/fonts"; import { FaArrowRight } from "react-icons/fa6"; import { MdOutlineLocalOffer } from "react-icons/md"; import { TbBasketExclamation } from "react-icons/tb"; import React from "react"; import { RootState } from "@/lib/store"; import { useAppSelector } from "@/lib/hooks/redux"; import Link from "next/link"; export default function CartPage() { const { cart, totalPrice, adjustedTotalPrice } = useAppSelector( (state: RootState) => state.carts ); return (
{cart && cart.items.length > 0 ? ( <>

your cart

{cart?.items.map((product, idx, arr) => ( {arr.length - 1 !== idx && (
)}
))}
Order Summary
Subtotal ${totalPrice}
Discount (- {Math.round( ((totalPrice - adjustedTotalPrice) / totalPrice) * 100 )} %) -${Math.round(totalPrice - adjustedTotalPrice)}
Delivery Fee Free

Total ${Math.round(adjustedTotalPrice)}
) : (
Your shopping cart is empty.
)}
); }