summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-promo/components/Section.tsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-01 08:48:48 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-01 08:48:48 +0700
commit0abd42f8b528b3166169fef7093d4d8b22f3fb79 (patch)
tree67e9896dd7f2f312e9aaffd4c02073a72889b25b /src-migrate/modules/product-promo/components/Section.tsx
parent4339c49be8f30dbb47b6882e61e909837dc91e81 (diff)
<iman> add pop up when hit keranjang button
Diffstat (limited to 'src-migrate/modules/product-promo/components/Section.tsx')
-rw-r--r--src-migrate/modules/product-promo/components/Section.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src-migrate/modules/product-promo/components/Section.tsx b/src-migrate/modules/product-promo/components/Section.tsx
index 4e8a7dd5..ff565539 100644
--- a/src-migrate/modules/product-promo/components/Section.tsx
+++ b/src-migrate/modules/product-promo/components/Section.tsx
@@ -9,12 +9,14 @@ import { IPromotion } from '~/types/promotion'
import { useModalStore } from "../stores/useModalStore"
import ProductPromoCard from './Card'
import ProductPromoModal from "./Modal"
+import { IProductDetail } from '~/types/product';
type Props = {
productId: number;
+ product: IProductDetail
}
-const ProductPromoSection = ({ productId }: Props) => {
+const ProductPromoSection = ({product, productId }: Props) => {
const promotionsQuery = useQuery({
queryKey: [`promotions.highlight`, productId],
queryFn: async () => await fetch(`/api/product-variant/${productId}/promotion/highlight`).then((res) => res.json()) as { data: IPromotion[] }
@@ -23,7 +25,7 @@ const ProductPromoSection = ({ productId }: Props) => {
const promotions = promotionsQuery.data
const { openModal } = useModalStore()
-
+ console.log("productId",productId)
return (
<SmoothRender
isLoaded={(promotions?.data && promotions?.data.length > 0) || false}
@@ -50,7 +52,7 @@ const ProductPromoSection = ({ productId }: Props) => {
>
{promotions?.data.map((promotion) => (
<div key={promotion.id} className="min-w-[400px] max-w-[400px]">
- <ProductPromoCard promotion={promotion} />
+ <ProductPromoCard product={product} promotion={promotion} />
</div>
))}
</Skeleton>