"use client"; import Image from "next/image"; import PersianNumber from "plugins/PersianNumber"; import React, { useContext, useState } from "react"; import p1 from "../../../public/images/product/1.png"; import AppContext from "@ctx/AppContext"; import Link from "next/link"; const CardCategories = ({ data }) => { const CTX = useContext(AppContext); const cart = CTX.state.cart; return (
<>
handleRoutineShiftPlanWithDay(index)} > {data.hasDiscount && (

%

{" "}
)} {data.hasDiscount && (

اصالت کالا

{" "}
)}

{data.persianName}{" "}

{data.hasDiscount && (

{" "} 3 عدد موجود انبار

)}
{/*{cart.find(e=>id)}*/} {!cart.find((item) => item.id === data.id) ? (
CTX.AddItemToCart(data.id, data.persianName, data.cost) } >
) : (
CTX.AddItemToCart(data.id, data.persianName, data.cost) } >

+

item.id === data.id).count} />

CTX.RemoveItemFromCart(data.id)} >

-

)}
{data.hasDiscount ? (

{" "}

تومان
) : (
{" "}

تومان
)}
); }; export default CardCategories;