Skip to content

Commit

Permalink
Merge pull request #335 from dharamveergit/feat-total-gpu
Browse files Browse the repository at this point in the history
Update: Gpu availability
  • Loading branch information
HoomanDgtl authored Aug 20, 2024
2 parents 486e021 + a67881d commit 0c0326c
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 0c0326c

Please sign in to comment.