summaryrefslogtreecommitdiff
path: root/src/lib/quotation/components/Quotation.jsx
diff options
context:
space:
mode:
authortrisusilo <tri.susilo@altama.co.id>2023-10-06 06:54:30 +0000
committertrisusilo <tri.susilo@altama.co.id>2023-10-06 06:54:30 +0000
commit1203225f97f4371823ef82103b89bcddf2bce59c (patch)
tree8c9fc18df252de1fd5afa57e64f13e005028f27a /src/lib/quotation/components/Quotation.jsx
parent010cbf9ff08835ed0cf61e821ce4db79f744893c (diff)
parent5d4cf836d098e9c351bce4d25f0e88e341646ccc (diff)
Merged in CR/Pricelist (pull request #92)
CR/Pricelist
Diffstat (limited to 'src/lib/quotation/components/Quotation.jsx')
-rw-r--r--src/lib/quotation/components/Quotation.jsx66
1 files changed, 2 insertions, 64 deletions
diff --git a/src/lib/quotation/components/Quotation.jsx b/src/lib/quotation/components/Quotation.jsx
index cee35457..8c379ead 100644
--- a/src/lib/quotation/components/Quotation.jsx
+++ b/src/lib/quotation/components/Quotation.jsx
@@ -16,6 +16,7 @@ import MobileView from '@/core/components/views/MobileView'
import DesktopView from '@/core/components/views/DesktopView'
import Image from '@/core/components/elements/Image/Image'
import { useQuery } from 'react-query'
+import CardProdcuctsList from '@/core/components/elements/Product/cartProductsList'
const { checkoutApi } = require('@/lib/checkout/api/checkoutApi')
const { getProductsCheckout } = require('@/lib/checkout/api/checkoutApi')
@@ -174,70 +175,7 @@ const Quotation = () => {
<div className='container mx-auto py-10 flex'>
<div className='w-3/4 border border-gray_r-6 rounded bg-white p-4'>
<div className='font-medium'>Detail Barang</div>
- <table className='table-checkout'>
- <thead>
- <tr>
- <th>Nama Produk</th>
- <th>Jumlah</th>
- <th>Harga</th>
- <th>Subtotal</th>
- </tr>
- </thead>
- <tbody>
- {products?.map((product) => (
- <tr key={product.id}>
- <td className='flex'>
- <div className='w-[30%] flex-shrink-0'>
- <Image
- src={product?.parent?.image}
- alt={product?.name}
- className='object-contain object-center border border-gray_r-6 h-40 w-full rounded-md'
- />
- </div>
- <div className='px-2 text-left'>
- <div className='line-clamp-2 leading-6 !text-gray_r-12 font-normal'>
- {product?.parent?.name}
- </div>
- <div className='text-gray_r-11 mt-2'>
- {product?.code}{' '}
- {product?.attributes.length > 0
- ? `| ${product?.attributes.join(', ')}`
- : ''}
- </div>
- </div>
- </td>
- <td>
- <input
- className='form-input w-16 py-2 text-center bg-gray_r-1'
- type='number'
- value={product?.quantity}
- disabled
- />
- </td>
- <td>
- {product?.price?.discountPercentage > 0 && (
- <div className='flex gap-x-1 items-center justify-center mt-3'>
- <div className='text-gray_r-11 line-through text-caption-1'>
- {currencyFormat(product?.price?.price)}
- </div>
- <div className='badge-solid-red'>
- {product?.price?.discountPercentage}%
- </div>
- </div>
- )}
- <div className='font-normal mt-1'>
- {currencyFormat(product?.price?.priceDiscount)}
- </div>
- </td>
- <td>
- <div className='text-danger-500 font-medium'>
- {currencyFormat(product?.price?.priceDiscount * product?.quantity)}
- </div>
- </td>
- </tr>
- ))}
- </tbody>
- </table>
+ <CardProdcuctsList isLoading={isLoading} products={products} source='checkout' />
</div>
<div className='w-1/4 pl-4'>