feat: polish bank operation cards and dates

This commit is contained in:
2026-09-12 19:56:12 +03:00
parent dedfec10d1
commit 6b310db0b8
20 changed files with 382 additions and 26 deletions
+3 -2
View File
@@ -11,7 +11,7 @@ import {
useBankSummary,
} from "@/entities/bank-card";
import { apiErrorCode } from "@/shared/api";
import { formatMoney } from "@/shared/lib";
import { formatDate, formatMoney } from "@/shared/lib";
function useCardPageVm() {
const { cardId } = useParams();
@@ -37,13 +37,14 @@ function useCardPageVm() {
(item.kind === "transfer" && item.cardId === cardId);
return {
item,
color: outgoing ? "red" : "green",
title:
item.kind === "transfer"
? t(outgoing ? "bank.transferTo" : "bank.transferFrom", {
name: outgoing ? item.targetCardName : item.cardName,
})
: t(`bank.kinds.${item.kind}`),
metadata: [item.date, item.categoryName, item.description]
metadata: [formatDate(item.date), item.categoryName, item.description]
.filter(Boolean)
.join(" · "),
value: `${outgoing ? "−" : "+"}${formatMoney(item.amount)}`,