summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/components/AddToQuotation.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src-migrate/modules/product-detail/components/AddToQuotation.tsx')
-rw-r--r--src-migrate/modules/product-detail/components/AddToQuotation.tsx20
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