diff --git a/src/app/dashboard/compliance/page.tsx b/src/app/dashboard/compliance/page.tsx new file mode 100644 index 0000000..3bdb556 --- /dev/null +++ b/src/app/dashboard/compliance/page.tsx @@ -0,0 +1,248 @@ +'use client'; + +import Link from 'next/link'; +import { useQuery } from '@tanstack/react-query'; +import { apiFetch } from '../../../lib/api'; +import { useSession } from '../../../components/session-provider'; + +interface Obligation { id: string; title: string; status: string; category: string; dueDate: string | null; riskLevel: string | null; } +interface Risk { id: string; title: string; status: string; probability: string; impact: string; riskScore: number | null; } +interface Contract { id: string; title: string; status: string; endDate: string | null; contractType: string; } +interface Transaction { id: string; description: string | null; amountMinorUnits: string; currency: string; evidenceStatus: string; transactionDate: string; } + +const B = '/dashboard'; + +function daysUntil(d: string) { return Math.ceil((new Date(d).getTime() - Date.now()) / 86400_000); } + +function ScoreBar({ value, max = 100, cls = '' }: { value: number; max?: number; cls?: string }) { + const pct = Math.min(100, Math.round((value / max) * 100)); + return ( +
Vedere consolidată a riscurilor, obligațiilor și dovezilor
+{score}
+/100 — actualizat în timp real
+{val}
+{label}
+ + ))} +✅ Nicio obligație urgentă
+ ) : ( +{o.title}
++ {o.category}{days !== null ? ` · ${days < 0 ? `${Math.abs(days)}z depășit` : `${days}z rămase`}` : ''} +
+✅ Niciun risc critic deschis
+ ) : ( +{r.title}
+{r.probability}/{r.impact}
+✅ Niciun contract expirant în 60 zile
+ ) : ( +{c.title}
+ + {days}z + +și alte {txMissing.length - 4}…
+ )} +