From 7cf105a01a814c5f76dd6b407df284a44026cabf Mon Sep 17 00:00:00 2001
From: Miqdad <ahmadmiqdad27@gmail.com>
Date: Wed, 12 Nov 2025 17:14:37 +0700
Subject: <Miqdad> done product detail

---
 .../product-detail/components/AddToQuotation.tsx     | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

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

diff --git a/src-migrate/modules/product-detail/components/AddToQuotation.tsx b/src-migrate/modules/product-detail/components/AddToQuotation.tsx
index ebfcef32..3e811330 100644
--- a/src-migrate/modules/product-detail/components/AddToQuotation.tsx
+++ b/src-migrate/modules/product-detail/components/AddToQuotation.tsx
@@ -60,6 +60,8 @@ const AddToQuotation = ({
     `fq=-manufacture_id_i:${product.manufacture?.id || 0}`,
   ].join('&');
   const [addCartAlert, setAddCartAlert] = useState(false);
+  const hasPrice =
+    !!product?.lowest_price && Number(product.lowest_price.price) > 0;
 
   const handleButton = async () => {
     if (typeof auth !== 'object') {
@@ -124,9 +126,10 @@ const AddToQuotation = ({
         color={'red'}
         colorScheme='white'
         className='w-full border-2 p-2 gap-1 hover:bg-slate-100 flex items-center'
+        isDisabled={!hasPrice}
       >
         <ImageNext
-          src= {isDesktop ? '/images/doc_red.svg' : '/images/doc.svg'}
+          src={isDesktop ? '/images/doc_red.svg' : '/images/doc.svg'}
           alt='penawaran instan'
           className=''
           width={25}
@@ -191,7 +194,20 @@ const AddToQuotation = ({
               </>
             )}
 
-            {!!product.lowest_price && product.lowest_price.price === 0 && (
+            {(!!product.lowest_price && product.lowest_price.price === 0) ||
+            product.lowest_price.price < 0 ? (
+              <span>
+                Hubungi kami untuk dapatkan harga terbaik,{' '}
+                <Link
+                  href={askAdminUrl}
+                  target='_blank'
+                  className='font-medium underline'
+                  color={'red'}
+                >
+                  klik disini
+                </Link>
+              </span>
+            ) : (
               <span>
                 Hubungi kami untuk dapatkan harga terbaik,{' '}
                 <Link
-- 
cgit v1.2.3

