Skip to content

Commit 1a16ec8

Browse files
ersinkocclaude
andcommitted
✨ feat(ui): add Expenses card to dashboard + StatsPanel
- Add expenses to SummaryData type (total, thisMonth, byCategory) - Add Expenses stat card to DashboardPage (orange, Receipt icon) - Add Expenses stat card to StatsPanel sidebar - Shows total count + this month's spending Now dashboard shows 7 stat cards: Tasks, Notes, Events, Contacts, Bookmarks, Habits, Expenses — complete PIM coverage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c8378de commit 1a16ec8

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

packages/ui/src/components/StatsPanel.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
Users,
2525
Bookmark,
2626
Repeat,
27+
Receipt,
2728
AlertCircle,
2829
TrendingUp,
2930
Cpu,
@@ -284,6 +285,19 @@ export function StatsPanel({ isCollapsed, onToggle }: StatsPanelProps) {
284285
color="text-emerald-500"
285286
/>
286287
)}
288+
{summary.expenses && (
289+
<StatCard
290+
icon={Receipt}
291+
label="Expenses"
292+
value={summary.expenses.total}
293+
subValue={
294+
summary.expenses.thisMonth > 0
295+
? `${summary.expenses.thisMonth.toFixed(0)} this month`
296+
: undefined
297+
}
298+
color="text-orange-500"
299+
/>
300+
)}
287301
</div>
288302
)}
289303

packages/ui/src/pages/DashboardPage.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
FileText,
88
Bookmark,
99
Repeat,
10+
Receipt,
1011
Users,
1112
Calendar,
1213
AlertTriangle,
@@ -151,6 +152,7 @@ export function DashboardPage() {
151152
const tasksTotal = summary?.tasks.total ?? 0;
152153
const completionPct = tasksTotal > 0 ? Math.round((tasksCompleted / tasksTotal) * 100) : 0;
153154
const habits = summary?.habits;
155+
const expenses = summary?.expenses;
154156

155157
const stats = summary
156158
? [
@@ -232,6 +234,22 @@ export function DashboardPage() {
232234
},
233235
]
234236
: []),
237+
...(expenses
238+
? [
239+
{
240+
label: 'Expenses',
241+
value: expenses.total,
242+
sub: expenses.thisMonth > 0
243+
? `${expenses.thisMonth.toFixed(0)} this month`
244+
: undefined,
245+
icon: Receipt,
246+
color: 'text-orange-500',
247+
bgColor: 'bg-orange-500/10',
248+
alert: false,
249+
link: '/expenses',
250+
},
251+
]
252+
: []),
235253
]
236254
: [];
237255

packages/ui/src/types/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface SummaryData {
4444
calendar: { total: number; today: number; upcoming: number };
4545
contacts: { total: number; favorites: number; upcomingBirthdays: number };
4646
habits?: { total: number; completedToday: number; totalToday: number; percentage: number; bestStreak: number };
47+
expenses?: { total: number; thisMonth: number; byCategory: Record<string, { amount: number; count: number }> };
4748
}
4849

4950
/** GET /api/v1/costs/usage */

0 commit comments

Comments
 (0)