From 23f67959168cd0126582c44f2a5b1bfdc45b268a Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 11 Oct 2023 10:22:11 +0700
Subject: Add breadcrumb on detail product, search, brand, category page

---
 .../product/components/Product/ProductDesktop.jsx  | 71 +++++++++++-----------
 1 file changed, 37 insertions(+), 34 deletions(-)

(limited to 'src/lib/product/components/Product/ProductDesktop.jsx')

diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx
index 47e98c1a..ceb0cad7 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -24,6 +24,7 @@ import ColumnsSLA from './ColumnsSLA'
 import { useProductCartContext } from '@/contexts/ProductCartContext'
 import { Box, Skeleton, Tooltip } from '@chakra-ui/react'
 import { Info } from 'lucide-react'
+import Breadcrumb from './Breadcrumb'
 
 const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
   const router = useRouter()
@@ -199,47 +200,49 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
   return (
     <DesktopView>
       <div className='container mx-auto pt-10'>
+        <Breadcrumb productId={product.id} productName={product.name} />
         <div className='flex'>
           <div className='w-full flex flex-wrap'>
             <div className='w-5/12'>
               <div className='relative mb-2'>
-                {product?.flashSale?.remainingTime > 0 && lowestPrice?.price.discountPercentage > 0 && (
-                  <div className={`absolute bottom-0 w-full`}>
-                    <div className='absolute bottom-0 w-full h-full'>
-                      <ImageNext
-                        src={backgorundFlashSale || '/images/GAMBAR-BG-FLASH-SALE.jpg'}
-                        width={1000}
-                        height={100}
-                      />
-                    </div>
-                    <div className='relative'>
-                      <div className='flex gap-x-2 items-center p-2'>
-                        <div className='bg-yellow-400 rounded-full p-1 h-9 w-20 flex items-center justify-center '>
-                          <span className='text-lg font-bold'>
-                            {Math.floor(product.lowestPrice.discountPercentage)}%
-                          </span>
-                        </div>
-                        <div
-                          className={`bg-red-600 border border-solid border-yellow-400 rounded-full h-9 p-2 flex w-[50%] items-center justify-center gap-x-4`}
-                        >
-                          <ImageNext
-                            src='/images/ICON_FLASH_SALE_WEBSITE_INDOTEKNIK.svg'
-                            width={17}
-                            height={10}
-                          />
-                          <span className='text-white text-lg font-semibold'>
-                            {product?.flashSale?.tag != 'false' || product?.flashSale?.tag
-                              ? product?.flashSale?.tag
-                              : 'FLASH SALE'}
-                          </span>
-                        </div>
-                        <div>
-                          <CountDown2 initialTime={product.flashSale.remainingTime} />
+                {product?.flashSale?.remainingTime > 0 &&
+                  lowestPrice?.price.discountPercentage > 0 && (
+                    <div className={`absolute bottom-0 w-full`}>
+                      <div className='absolute bottom-0 w-full h-full'>
+                        <ImageNext
+                          src={backgorundFlashSale || '/images/GAMBAR-BG-FLASH-SALE.jpg'}
+                          width={1000}
+                          height={100}
+                        />
+                      </div>
+                      <div className='relative'>
+                        <div className='flex gap-x-2 items-center p-2'>
+                          <div className='bg-yellow-400 rounded-full p-1 h-9 w-20 flex items-center justify-center '>
+                            <span className='text-lg font-bold'>
+                              {Math.floor(product.lowestPrice.discountPercentage)}%
+                            </span>
+                          </div>
+                          <div
+                            className={`bg-red-600 border border-solid border-yellow-400 rounded-full h-9 p-2 flex w-[50%] items-center justify-center gap-x-4`}
+                          >
+                            <ImageNext
+                              src='/images/ICON_FLASH_SALE_WEBSITE_INDOTEKNIK.svg'
+                              width={17}
+                              height={10}
+                            />
+                            <span className='text-white text-lg font-semibold'>
+                              {product?.flashSale?.tag != 'false' || product?.flashSale?.tag
+                                ? product?.flashSale?.tag
+                                : 'FLASH SALE'}
+                            </span>
+                          </div>
+                          <div>
+                            <CountDown2 initialTime={product.flashSale.remainingTime} />
+                          </div>
                         </div>
                       </div>
                     </div>
-                  </div>
-                )}
+                  )}
                 <Image
                   src={product.image}
                   alt={product.name}
-- 
cgit v1.2.3

