diff --git a/src/app/dashboard/reports/financial/page.tsx b/src/app/dashboard/reports/financial/page.tsx new file mode 100644 index 0000000..46b3b7e --- /dev/null +++ b/src/app/dashboard/reports/financial/page.tsx @@ -0,0 +1,171 @@ +'use client'; + +import Link from 'next/link'; +import { useQuery } from '@tanstack/react-query'; +import { apiFetch } from '../../../../lib/api'; +import type { Transaction } from '../../../../lib/api'; +import { useSession } from '../../../../components/session-provider'; + +const B = '/dashboard'; + +function fmtMoney(minorUnits: number, currency: string): string { + const major = minorUnits / 100; + return new Intl.NumberFormat('ro-RO', { style: 'currency', currency, minimumFractionDigits: 0 }).format(major); +} + +function MonthBar({ label, value, maxVal }: { label: string; value: number; maxVal: number }) { + const pct = maxVal > 0 ? Math.round((value / maxVal) * 100) : 0; + return ( +
+ {transactions.length} tranzacții înregistrate +
+Nicio tranzacție înregistrată
+ + Adaugă prima tranzacție → + ++ {evByStatus[key] ?? 0} +
+{label}
+