|
|
@@ -1,9 +1,16 @@
|
|
|
"use client";
|
|
|
|
|
|
import AddToCartModal from "./AddToCartModal";
|
|
|
+import { useAppSelector } from "@/store/hooks";
|
|
|
|
|
|
export function AddToCartModalWrapper() {
|
|
|
- return <AddToCartModal />;
|
|
|
+ const {product} = useAppSelector((state) => state.addToCartDialog);
|
|
|
+ if(product) {
|
|
|
+ return <AddToCartModal />;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// import { useAppSelector } from "@/store/hooks";
|