From 64fe76872524253b0dc84d094c76ef5761a047c1 Mon Sep 17 00:00:00 2001 From: bankjirapan Date: Thu, 20 Feb 2025 23:07:59 +0700 Subject: [PATCH] refactor: fix conditional check for content formatting in statistics column --- .../Settings/Clients/ClientsTable/ClientsTable.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/components/Settings/Clients/ClientsTable/ClientsTable.tsx b/client/src/components/Settings/Clients/ClientsTable/ClientsTable.tsx index 55d3e72f..f7dce6ef 100644 --- a/client/src/components/Settings/Clients/ClientsTable/ClientsTable.tsx +++ b/client/src/components/Settings/Clients/ClientsTable/ClientsTable.tsx @@ -300,12 +300,15 @@ const ClientsTable = ({ sortMethod: (a: any, b: any) => b - a, minWidth: 120, Cell: (row: any) => { - let content = CellWrap(row); - - if (!row.value) { - return content; + let content = row.value; + if (typeof content === "number") { + content = formatNumber(content); + } else { + content = CellWrap(row); } - content = typeof content === "number" ? formatNumber(content) : content; + if (!content) { + return content; + } return {content}; }, },