From 80a94c48c3cfada2a4e541f042d71010aeb66df0 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Fri, 27 Feb 2026 15:38:11 +0700 Subject: [PATCH] refactor(FE): Format product prices using `formatCurrency` helper --- .../pages/master-data/product/ProductTable.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/pages/master-data/product/ProductTable.tsx b/src/components/pages/master-data/product/ProductTable.tsx index 9d0dee22..c265be55 100644 --- a/src/components/pages/master-data/product/ProductTable.tsx +++ b/src/components/pages/master-data/product/ProductTable.tsx @@ -24,7 +24,7 @@ import RequirePermission from '@/components/helper/RequirePermission'; import { Product } from '@/types/api/master-data/product'; import { ProductApi } from '@/services/api/master-data'; -import { cn } from '@/lib/helper'; +import { cn, formatCurrency } from '@/lib/helper'; import { isResponseError, isResponseSuccess } from '@/lib/api-helper'; import { useTableFilter } from '@/services/hooks/useTableFilter'; import { ROWS_OPTIONS } from '@/config/constant'; @@ -155,13 +155,17 @@ const ProductsTable = () => { accessorKey: 'product_price', header: 'Harga Produk', cell: (props) => - props.row.original.product_price?.toLocaleString() ?? '-', + props.row.original.product_price + ? formatCurrency(props.row.original.product_price) + : '-', }, { accessorKey: 'selling_price', header: 'Harga Jual', cell: (props) => - props.row.original.selling_price?.toLocaleString() ?? '-', + props.row.original.selling_price + ? formatCurrency(props.row.original.selling_price) + : '-', }, { accessorKey: 'tax',