diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-11-12 17:14:37 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-11-12 17:14:37 +0700 |
| commit | 7cf105a01a814c5f76dd6b407df284a44026cabf (patch) | |
| tree | 12bf20c8560bbe6faff9dc182948524ad0d318a7 /src-migrate/modules/product-detail/components/AddToQuotation.tsx | |
| parent | cd51b64b48b0c898c6ff901c1bfa23c70cd9cf1a (diff) | |
<Miqdad> done product detail
Diffstat (limited to 'src-migrate/modules/product-detail/components/AddToQuotation.tsx')
| -rw-r--r-- | src-migrate/modules/product-detail/components/AddToQuotation.tsx | 20 |
1 files changed, 18 insertions, 2 deletions
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 |
