fix: Recent Transactions widget ignored the selected dashboard month

RecentTransactionsCard queried transactions without year/month filters,
so it always showed the latest 6 transactions globally instead of the
ones for the month picked in the MonthSelector. DashboardPage now
passes its year/month state down to the card, which forwards it to
useTransactions.
This commit is contained in:
ZProger
2026-08-16 21:51:32 +03:00
parent a8c6728860
commit c905cea84e
3 changed files with 9 additions and 4 deletions

View File

@@ -5,9 +5,14 @@ import { formatCurrency, formatTransactionDate } from "@/lib/format";
import { useTranslation } from "@/lib/i18n";
import { useTransactions } from "@/hooks/useTransactions";
export function RecentTransactionsCard() {
interface RecentTransactionsCardProps {
year: number;
month: number;
}
export function RecentTransactionsCard({ year, month }: RecentTransactionsCardProps) {
const { t } = useTranslation();
const { data, isLoading } = useTransactions({ page: 1, page_size: 6 });
const { data, isLoading } = useTransactions({ year, month, page: 1, page_size: 6 });
return (
<Card>