From a67881dbd8c2a23a8975fbf58ac6fe16e1e0a09e Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Wed, 14 Aug 2024 23:20:06 +0530 Subject: [PATCH] update gpu-table.tsx --- src/components/gpu-table/gpu-table.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/gpu-table/gpu-table.tsx b/src/components/gpu-table/gpu-table.tsx index a91e0bce..a79c34cb 100644 --- a/src/components/gpu-table/gpu-table.tsx +++ b/src/components/gpu-table/gpu-table.tsx @@ -156,11 +156,24 @@ export const Tables = ({
- {data?.availability?.available || 0} + {filteredData?.length > 0 + ? filteredData?.reduce( + (prev, curr) => + prev + (curr?.availability?.available ?? 0), + 0, + ) + : data?.availability?.available || 0} - (of {data?.availability?.total || 0}) + (of{" "} + {filteredData?.length > 0 + ? filteredData?.reduce( + (prev, curr) => prev + (curr?.availability?.total ?? 0), + 0, + ) + : data?.availability?.total || 0} + )