diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-16 16:08:43 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-16 16:08:43 +0700 |
| commit | a70fd5b6d9c7a769ac1aaa22a7d037ba3be27a05 (patch) | |
| tree | 825d6b5de089bb22003bb2a517d371dc291f1962 /src-migrate/modules/product-detail/components/Information.tsx | |
| parent | d9dafa74857959974e9d379dc1a3abfbaf2af83d (diff) | |
Update improve product detail performance
Diffstat (limited to 'src-migrate/modules/product-detail/components/Information.tsx')
| -rw-r--r-- | src-migrate/modules/product-detail/components/Information.tsx | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/src-migrate/modules/product-detail/components/Information.tsx b/src-migrate/modules/product-detail/components/Information.tsx index fd0e0b3c..52eb6b88 100644 --- a/src-migrate/modules/product-detail/components/Information.tsx +++ b/src-migrate/modules/product-detail/components/Information.tsx @@ -9,6 +9,7 @@ import { IProductDetail } from '~/types/product' import { IProductVariantSLA } from '~/types/productVariant' import { createSlug } from '~/libs/slug' import { getVariantSLA } from '~/services/productVariant' +import { formatToShortText } from '~/libs/formatNumber' const Skeleton = dynamic(() => import('@chakra-ui/react').then((mod) => mod.Skeleton)) @@ -31,10 +32,6 @@ const Information = ({ product }: Props) => { <div className={style['label']}>SKU Number</div> <div className={style['value']}>SKU-{product.id}</div> </div> - {/* <div className={style['row']}> - <div className={style['label']}>Part Number</div> - <div className={style['value']}>{product.code || '-'}</div> - </div> */} <div className={style['row']}> <div className={style['label']}>Manufacture</div> <div className={style['value']}> @@ -48,35 +45,10 @@ const Information = ({ product }: Props) => { ) : '-'} </div> </div> - {/* <div className={style['row']}> - <div className={style['label']}>Preparation Time</div> - <div className={style['value']}> - {product.variant_total > 1 && 'Lihat Variant'} - {product.variant_total === 1 && ( - <Skeleton isLoaded={querySLA.isSuccess} w={querySLA.isSuccess ? '100%' : '40px'} h='100%'> - {sla?.sla_date} - </Skeleton> - )} - </div> - </div> <div className={style['row']}> - <div className={style['label']}>Stock</div> - <div className={style['value']}> - {product.variant_total > 1 && 'Lihat Variant'} - {product.variant_total === 1 && ( - <Skeleton isLoaded={querySLA.isSuccess} w={querySLA.isSuccess ? '100%' : '10px'} h='100%'> - {sla?.qty && sla.qty > 0 ? sla?.qty : '-'} - </Skeleton> - )} - </div> + <div className={style['label']}>Terjual</div> + <div className={style['value']}>{product.qty_sold > 0 ? formatToShortText(product.qty_sold) : '-'}</div> </div> - <div className={style['row']}> - <div className={style['label']}>Weight</div> - <div className={style['value']}> - {product.variant_total > 1 && 'Lihat Variant'} - {product.variant_total === 1 && (product.weight > 0 ? `${product.weight} kg` : '-')} - </div> - </div> */} </div> ) } |
