diff --git a/src/features/home/DashboardView.tsx b/src/features/home/DashboardView.tsx index 6ae8c3c..28b8b96 100644 --- a/src/features/home/DashboardView.tsx +++ b/src/features/home/DashboardView.tsx @@ -3,10 +3,10 @@ import * as React from "react"; import Link from "next/link"; import { Skeleton, ProgressCircleRoot, ProgressCircleTrack, ProgressCircleRange } from "@seed-design/react"; -import { Card, AmountToggle, HideAmountsToggle } from "../../ds"; +import { Card, AmountToggle, HideAmountsToggle, IconChip, SectionHeader, EmptyState, categoryStyle } from "../../ds"; import { tugrikShortRaw } from "../../ds/money"; import { useNetWorth, useAnalyzeMonth, useAnalyzeToday, useBudget } from "../../api/hooks/reads"; -import { buildHome, type HomeData } from "./buildHome"; +import { buildHome, type HomeData, type LedgerRow as LedgerRowData } from "./buildHome"; import { sample } from "./sample"; import { homeStrings as s } from "./strings"; @@ -42,6 +42,56 @@ function TugrikCircle({ bg, fg }: { bg: string; fg: string }) { ); } +/** One Орлого/Зарлага row: an IconChip (income → the wallet/green "income" + * style; expense → the payee's category style, falling back to a neutral + * receipt when unknown) + the payee name + a trailing colored amount. + * Mirrors TransactionList's TxnRow pattern. */ +function LedgerEntryRow({ row, income }: { row: LedgerRowData; income: boolean }) { + const cat = categoryStyle(income ? undefined : row.date, income); + return ( +