Skip to content

Commit

Permalink
update gpu-table.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
dharamveergit committed Aug 14, 2024
1 parent 486e021 commit a67881d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/components/gpu-table/gpu-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,24 @@ export const Tables = ({
</h2>
<div className="rounded-md border p-2 shadow-sm ">
<span className="text-base font-bold">
{data?.availability?.available || 0}
{filteredData?.length > 0
? filteredData?.reduce(
(prev, curr) =>
prev + (curr?.availability?.available ?? 0),
0,
)
: data?.availability?.available || 0}
</span>

<span className="ml-2 text-sm text-linkText">
(of {data?.availability?.total || 0})
(of{" "}
{filteredData?.length > 0
? filteredData?.reduce(
(prev, curr) => prev + (curr?.availability?.total ?? 0),
0,
)
: data?.availability?.total || 0}
)
</span>
</div>
</div>
Expand Down

0 comments on commit a67881d

Please sign in to comment.