Skip to content

Commit 816aa61

Browse files
committed
[Dashboard] Fix: Display latest value in PayNewCustomers component (#7002)
🤖 Generated with [Claude Code](https://claude.ai/code) <!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on improving the logic used to display the total value in the `SkeletonContainer` of the `PayNewCustomers` component. It ensures that when `graphData` is empty, it returns "NA", and otherwise, it retrieves the last value or defaults to 0. ### Detailed summary - Updated the logic in `SkeletonContainer`: - Changed the expression to return `graphData[graphData.length - 1]?.value || 0` when `graphData` is not empty. - Maintained the output of "NA" when `isEmpty` is true. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 7de273c commit 816aa61

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

apps/dashboard/src/components/pay/PayAnalytics/components/PayNewCustomers.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ export function PayNewCustomers(props: {
7474
<div className="mb-5 flex items-center gap-3">
7575
<SkeletonContainer
7676
loadedData={
77-
isEmpty
78-
? "NA"
79-
: graphData.reduce((acc, curr) => acc + curr.value, 0)
77+
isEmpty ? "NA" : graphData[graphData.length - 1]?.value || 0
8078
}
8179
skeletonData={100}
8280
render={(v) => {

0 commit comments

Comments
 (0)