Commit 56d27d4
committed
[Dashboard] Sort usage categories by total amount in descending order (#7314)
# Sort usage categories by total amount
This PR sorts the usage categories displayed on the team usage page by their total amount in descending order. Categories with higher total costs will now appear at the top of the list, making it easier for users to identify their most significant expenses at a glance.
The implementation:
- Creates a `sortedCategories` array by sorting the usage preview data
- Sorts based on the sum of `amountUsdCents` for each category's line items
- Uses the sorted array in the render function instead of the original data
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Enhancements**
- Usage categories are now displayed in descending order based on their subtotal amounts, making it easier to identify the highest usage categories at a glance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent e742929 commit 56d27d4
File tree
1 file changed
+14
-1
lines changed- apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/usage
1 file changed
+14
-1
lines changedLines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
64 | 77 | | |
65 | 78 | | |
66 | 79 | | |
| |||
112 | 125 | | |
113 | 126 | | |
114 | 127 | | |
115 | | - | |
| 128 | + | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
| |||
0 commit comments