import { Card, CardContent } from "@/components/ui/card"; import { tr } from "@/i18n/tr"; import { cn } from "@/lib/utils"; import { formatMoney } from "@/shared/format"; import type { NetWorth } from "../service"; const t = tr.assets.netWorth; /** Net varlık dökümü: artılar ve eksiler, altta toplam. */ export function NetWorthCard({ data }: { data: NetWorth }) { const rows: { label: string; minor: number; sign: 1 | -1 }[] = [ { label: t.accounts, minor: data.accountsMinor, sign: 1 }, { label: t.assets, minor: data.assetsMinor, sign: 1 }, { label: t.contactReceivable, minor: data.contactReceivableMinor, sign: 1 }, { label: t.inKindReceivable, minor: data.inKindReceivableMinor, sign: 1 }, { label: t.cardDebt, minor: data.cardDebtMinor, sign: -1 }, { label: t.contactPayable, minor: data.contactPayableMinor, sign: -1 }, { label: t.inKindPayable, minor: data.inKindPayableMinor, sign: -1 }, ]; const plus = rows.filter((r) => r.sign === 1); const minus = rows.filter((r) => r.sign === -1); const list = (items: typeof rows) => (
{formatMoney(data.totalMinor)}
{t.description}
{t.missingPrice(data.missingPrice)}
) : null} {data.includesHidden ? ({t.includesHidden}
) : null}