From d2fb20c30fa3440369807c05d01897eb19483f4c Mon Sep 17 00:00:00 2001
From: FIN-IT_AndriFP <andrifebriyadiputra@gmail.com>
Date: Mon, 8 Dec 2025 14:55:49 +0700
Subject: (andri) modal compare without data

---
 .../product-detail/components/PriceAction.tsx      | 38 ++++++----------------
 1 file changed, 10 insertions(+), 28 deletions(-)

(limited to 'src-migrate/modules/product-detail/components/PriceAction.tsx')

diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx
index d73ab5f6..ee8009ef 100644
--- a/src-migrate/modules/product-detail/components/PriceAction.tsx
+++ b/src-migrate/modules/product-detail/components/PriceAction.tsx
@@ -1,5 +1,4 @@
 import style from '../styles/price-action.module.css';
-
 import Image from 'next/image';
 import Link from 'next/link';
 import { useEffect, useState } from 'react';
@@ -15,14 +14,17 @@ import { Button, Skeleton } from '@chakra-ui/react';
 import DesktopView from '@/core/components/views/DesktopView';
 import MobileView from '@/core/components/views/MobileView';
 
+// 1. Tambahkan onCompare (Optional) di sini
 type Props = {
   product: IProductDetail;
+  onCompare?: () => void; 
 };
 
 const PPN: number = process.env.NEXT_PUBLIC_PPN
   ? parseFloat(process.env.NEXT_PUBLIC_PPN)
   : 0;
-const PriceAction = ({ product }: Props) => {
+
+const PriceAction = ({ product, onCompare }: Props) => {
   const {
     activePrice,
     setActive,
@@ -146,19 +148,6 @@ const PriceAction = ({ product }: Props) => {
         </>
       )}
 
-      {/* {!!activePrice && activePrice.price === 0 && (
-        <span>
-          Hubungi kami untuk dapatkan harga terbaik,{' '}
-          <Link
-            href={askAdminUrl}
-            target='_blank'
-            className={style['contact-us']}
-          >
-            klik disini
-          </Link>
-        </span>
-      )} */}
-
       <DesktopView>
         <div className='h-4' />
         <div className='flex gap-x-5 items-center'>
@@ -227,9 +216,6 @@ const PriceAction = ({ product }: Props) => {
             )}
           </div>
         </div>
-        {/* <span className='text-[12px] text-red-500 italic'>
-          * {qtyPickUp} barang bisa di pickup
-        </span> */}
       </DesktopView>
 
       {/* ===== MOBILE: grid kiri-kanan, kanan hanya qty ===== */}
@@ -263,12 +249,6 @@ const PriceAction = ({ product }: Props) => {
                 </Link>
               )}
             </div>
-
-            {/* {qtyPickUp > 0 && (
-              <div className='text-[12px] mt-1 text-red-500 italic'>
-                * {qtyPickUp} barang bisa di pickup
-              </div>
-            )} */}
           </div>
 
           {/* Kanan: hanya qty, rata kanan */}
@@ -295,9 +275,9 @@ const PriceAction = ({ product }: Props) => {
                 value={quantityInput}
                 onChange={(e) => setQuantityInput(e.target.value)}
                 className='h-11 md:h-12 w-16 md:w-20 text-center text-lg md:text-xl outline-none border-x
-               [appearance:textfield] 
-               [&::-webkit-outer-spin-button]:appearance-none 
-               [&::-webkit-inner-spin-button]:appearance-none'
+                [appearance:textfield] 
+                [&::-webkit-outer-spin-button]:appearance-none 
+                [&::-webkit-inner-spin-button]:appearance-none'
                 disabled={!hasPrice}
               />
 
@@ -335,11 +315,13 @@ const PriceAction = ({ product }: Props) => {
           )}
         </div>
         <div className='mt-4'>
+          {/* 2. TERUSKAN onCompare KE SINI */}
           <AddToQuotation
             source='buy'
             products={product}
             variantId={activeVariantId}
             quantity={Number(quantityInput)}
+            onCompare={onCompare} 
           />
         </div>
       </DesktopView>
@@ -376,4 +358,4 @@ const PriceAction = ({ product }: Props) => {
   );
 };
 
-export default PriceAction;
+export default PriceAction;
\ No newline at end of file
-- 
cgit v1.2.3

