mirror of
https://github.com/onyx-dot-app/onyx.git
synced 2026-10-22 03:14:06 -05:00
fix(usage): sort per-model usage breakdown by cost descending (#13676)
This commit is contained in:
1 parent
2b2e3c668a
commit
fc73de040e
1 file changed
+5
-1
@@ -48,6 +48,10 @@ function WindowCostSection({ windowCostCents, rows }: WindowCostSectionProps) {
|
||||
0
|
||||
);
|
||||
const hasCache = rows.some((row) => row.cache_read_tokens > 0);
|
||||
const sortedRows = useMemo(
|
||||
() => [...rows].sort((a, b) => b.cost_cents - a.cost_cents),
|
||||
[rows]
|
||||
);
|
||||
|
||||
return (
|
||||
<Section gap={0.75} justifyContent="start">
|
||||
@@ -68,7 +72,7 @@ function WindowCostSection({ windowCostCents, rows }: WindowCostSectionProps) {
|
||||
/>
|
||||
) : (
|
||||
<Card>
|
||||
{rows.map((row, index) => (
|
||||
{sortedRows.map((row, index) => (
|
||||
<div key={`${row.day}-${row.model}`}>
|
||||
{index > 0 && <Divider />}
|
||||
<Section gap={0.5} alignItems="start" justifyContent="start">
|
||||
|
||||
Reference in new issue
Block a user