amliq-dashboard 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (492) hide show
  1. package/.env.example +3 -0
  2. package/.env.production +1 -0
  3. package/Dockerfile +26 -0
  4. package/QUICK_START.md +267 -0
  5. package/README.md +161 -0
  6. package/TESTING_GUIDE.md +322 -0
  7. package/dist/.well-known/ai-plugin.json +15 -0
  8. package/dist/_headers +8 -0
  9. package/dist/_redirects +1 -0
  10. package/dist/assets/APIKeys-BvwFauIs.js +6 -0
  11. package/dist/assets/APIKeys-DaMSBZQL.js +1 -0
  12. package/dist/assets/AdverseMedia-DckXfMzS.js +4 -0
  13. package/dist/assets/AlertDetailPage-Bc2_zwu_.js +1 -0
  14. package/dist/assets/AlertQueue-DFtBiRoM.js +8 -0
  15. package/dist/assets/Analytics-DtruB5lQ.js +1 -0
  16. package/dist/assets/AuditTrail-BK68ePu0.js +1 -0
  17. package/dist/assets/AuthDivider-gRHEt7gx.js +1 -0
  18. package/dist/assets/Badge-B9VFkofy.js +1 -0
  19. package/dist/assets/BatchJobs-Bz6KFnXD.js +6 -0
  20. package/dist/assets/BillingPage-R9nQ5nFb.js +11 -0
  21. package/dist/assets/Card-Cw-T_-oU.js +1 -0
  22. package/dist/assets/CaseDetail-DYs7Zg_y.js +7 -0
  23. package/dist/assets/CaseManagement-B1Q4Dp1Y.js +1 -0
  24. package/dist/assets/ComplianceReport-Dhssqc9T.js +1 -0
  25. package/dist/assets/Configuration-B92kl9T0.js +1 -0
  26. package/dist/assets/CryptoScreening-C7yFlskC.js +1 -0
  27. package/dist/assets/Dashboard-w4-Nhv9q.js +17 -0
  28. package/dist/assets/DataSources-u3-Ri_5_.js +3 -0
  29. package/dist/assets/EDDWorkflow-CFzlEO0e.js +1 -0
  30. package/dist/assets/EmptyState-Do0xJAT9.js +6 -0
  31. package/dist/assets/ForgotPassword-BPYyQFQp.js +1 -0
  32. package/dist/assets/LandingPage-CjaP0zw4.js +41 -0
  33. package/dist/assets/ListsMarketplace-CG6KkT9B.js +6 -0
  34. package/dist/assets/Login-677LEGP1.js +1 -0
  35. package/dist/assets/MFASetup-BxqCPvui.js +1 -0
  36. package/dist/assets/Monitoring-9TN9MK4y.js +1 -0
  37. package/dist/assets/Onboarding-Cf0Y83lX.js +1 -0
  38. package/dist/assets/Operations-CcXwc2xw.js +10 -0
  39. package/dist/assets/Overview-B_Ky0VWV.js +1 -0
  40. package/dist/assets/PEPScreening-pUQjTH9c.js +1 -0
  41. package/dist/assets/PageHeader-BObHFn0i.js +1 -0
  42. package/dist/assets/PrivacyPolicy-DZ2xrKir.js +1 -0
  43. package/dist/assets/ResetPassword-AtxtpIG1.js +1 -0
  44. package/dist/assets/RiskAssessment-Dzuh1Usv.js +1 -0
  45. package/dist/assets/SARForm-D8w2ZGe-.js +1 -0
  46. package/dist/assets/SanctionsLists-CPA3UH2v.js +1 -0
  47. package/dist/assets/ScheduledTasks-Dsjk-6UR.js +1 -0
  48. package/dist/assets/ScreenEntity-D1U0YL7v.js +3 -0
  49. package/dist/assets/ScreeningProgress-BW49PzoB.js +66 -0
  50. package/dist/assets/SearchField-CulFKdiI.js +1 -0
  51. package/dist/assets/Signup-C0FmFOo_.js +1 -0
  52. package/dist/assets/SystemHealth-B_8u4eva.js +1 -0
  53. package/dist/assets/TaskHistory-BCmEM89q.js +3 -0
  54. package/dist/assets/Team-CUo_FlU7.js +1 -0
  55. package/dist/assets/TenantDetail-CgZQHUY8.js +1 -0
  56. package/dist/assets/Tenants-RB9E9ick.js +2 -0
  57. package/dist/assets/TermsOfService-BfL-kndX.js +1 -0
  58. package/dist/assets/TransactionMonitoring-DGh_T22s.js +14 -0
  59. package/dist/assets/TxnScreening-B7cm2-eh.js +1 -0
  60. package/dist/assets/UBOChain-falXAsCo.js +1 -0
  61. package/dist/assets/Users-Doakpg9c.js +1 -0
  62. package/dist/assets/Webhooks-BZpAfaxv.js +1 -0
  63. package/dist/assets/alert-triangle-YCFVm7B_.js +6 -0
  64. package/dist/assets/alerts-COUnTwWY.js +1 -0
  65. package/dist/assets/arrow-left-9ApLqP95.js +6 -0
  66. package/dist/assets/check-VTcvVtIU.js +6 -0
  67. package/dist/assets/check-circle-2-Dn-lG5YQ.js +6 -0
  68. package/dist/assets/code-DIJRWFVv.js +6 -0
  69. package/dist/assets/fingerprint-C0MGVtax.js +6 -0
  70. package/dist/assets/flag-B8_Gwxh6.js +6 -0
  71. package/dist/assets/index-CfdYcqRM.js +289 -0
  72. package/dist/assets/index-HPU_Rhdu.css +1 -0
  73. package/dist/assets/layers-zHz2o4vo.js +6 -0
  74. package/dist/assets/loader-B9_dNihg.js +6 -0
  75. package/dist/assets/mail-BijL2qwp.js +6 -0
  76. package/dist/assets/plus-i0oBIIPS.js +6 -0
  77. package/dist/assets/refresh-cw-CSuAwutt.js +6 -0
  78. package/dist/assets/useAnalytics-Bj8IONcw.js +72 -0
  79. package/dist/assets/x-circle-DLGKvijE.js +6 -0
  80. package/dist/favicon.svg +15 -0
  81. package/dist/index.html +51 -0
  82. package/dist/llms.txt +28 -0
  83. package/dist/logo.png +0 -0
  84. package/dist/logo.svg +17 -0
  85. package/dist/manifest.json +44 -0
  86. package/dist/robots.txt +15 -0
  87. package/dist/schema.json +13 -0
  88. package/dist/sitemap.xml +28 -0
  89. package/dist/sw.js +67 -0
  90. package/e2e/auth-setup.ts +20 -0
  91. package/e2e/billing.spec.ts +50 -0
  92. package/e2e/cases.spec.ts +53 -0
  93. package/e2e/compliance.spec.ts +65 -0
  94. package/e2e/config.spec.ts +56 -0
  95. package/e2e/dashboard.spec.ts +47 -0
  96. package/e2e/fixtures.ts +33 -0
  97. package/e2e/lists.spec.ts +43 -0
  98. package/e2e/login.spec.ts +64 -0
  99. package/e2e/media.spec.ts +48 -0
  100. package/e2e/mocks.ts +51 -0
  101. package/e2e/monitoring.spec.ts +44 -0
  102. package/e2e/navigation.spec.ts +56 -0
  103. package/e2e/onboarding.spec.ts +49 -0
  104. package/e2e/responsive.spec.ts +40 -0
  105. package/e2e/risk.spec.ts +61 -0
  106. package/e2e/screening.spec.ts +76 -0
  107. package/e2e/team.spec.ts +53 -0
  108. package/index.html +50 -0
  109. package/package.json +47 -0
  110. package/playwright.config.ts +35 -0
  111. package/postcss.config.js +6 -0
  112. package/public/.well-known/ai-plugin.json +15 -0
  113. package/public/_headers +8 -0
  114. package/public/_redirects +1 -0
  115. package/public/favicon.svg +15 -0
  116. package/public/llms.txt +28 -0
  117. package/public/logo.png +0 -0
  118. package/public/logo.svg +17 -0
  119. package/public/manifest.json +44 -0
  120. package/public/robots.txt +15 -0
  121. package/public/schema.json +13 -0
  122. package/public/sitemap.xml +28 -0
  123. package/public/sw.js +67 -0
  124. package/scripts/test-runner.sh +152 -0
  125. package/src/App.tsx +48 -0
  126. package/src/api/alerts.ts +19 -0
  127. package/src/api/analytics.ts +6 -0
  128. package/src/api/audit.ts +11 -0
  129. package/src/api/auth.ts +26 -0
  130. package/src/api/billing.ts +54 -0
  131. package/src/api/cases.ts +48 -0
  132. package/src/api/client.ts +50 -0
  133. package/src/api/config.ts +30 -0
  134. package/src/api/edd.ts +25 -0
  135. package/src/api/enforcement.ts +33 -0
  136. package/src/api/lists.ts +24 -0
  137. package/src/api/monitoring.ts +82 -0
  138. package/src/api/pep.ts +30 -0
  139. package/src/api/risk.ts +26 -0
  140. package/src/api/screening.ts +37 -0
  141. package/src/api/team.ts +27 -0
  142. package/src/api/transactions.ts +37 -0
  143. package/src/components/admin/TenantCards.tsx +51 -0
  144. package/src/components/alerts/AlertActions.test.tsx +80 -0
  145. package/src/components/alerts/AlertActions.tsx +68 -0
  146. package/src/components/alerts/AlertCard.test.tsx +86 -0
  147. package/src/components/alerts/AlertCard.tsx +60 -0
  148. package/src/components/alerts/AlertDetailSidebar.tsx +63 -0
  149. package/src/components/alerts/AlertFilters.test.tsx +73 -0
  150. package/src/components/alerts/AlertFilters.tsx +88 -0
  151. package/src/components/alerts/EntityDetailsCard.test.tsx +61 -0
  152. package/src/components/alerts/EntityDetailsCard.tsx +37 -0
  153. package/src/components/alerts/NotesCard.test.tsx +39 -0
  154. package/src/components/alerts/NotesCard.tsx +28 -0
  155. package/src/components/auth/AuthDivider.tsx +18 -0
  156. package/src/components/auth/LoginForm.tsx +62 -0
  157. package/src/components/auth/LoginLeftPanel.tsx +43 -0
  158. package/src/components/auth/PasswordStrength.tsx +26 -0
  159. package/src/components/auth/SignInButtons.tsx +46 -0
  160. package/src/components/auth/SignupLeftPanel.tsx +35 -0
  161. package/src/components/auth/countries.ts +17 -0
  162. package/src/components/charts/AreaChart.tsx +45 -0
  163. package/src/components/charts/BarChart.tsx +48 -0
  164. package/src/components/charts/DonutChart.tsx +47 -0
  165. package/src/components/compliance/CaseActions.tsx +74 -0
  166. package/src/components/compliance/CaseTimeline.tsx +68 -0
  167. package/src/components/compliance/MediaResultCard.tsx +87 -0
  168. package/src/components/compliance/PEPResultCard.tsx +78 -0
  169. package/src/components/config/MatchingModesCard.test.tsx +75 -0
  170. package/src/components/config/MatchingModesCard.tsx +40 -0
  171. package/src/components/config/ScreeningLayersCard.test.tsx +57 -0
  172. package/src/components/config/ScreeningLayersCard.tsx +36 -0
  173. package/src/components/config/ThresholdsCard.test.tsx +79 -0
  174. package/src/components/config/ThresholdsCard.tsx +51 -0
  175. package/src/components/dashboard/ActivityFeed.tsx +93 -0
  176. package/src/components/dashboard/DashboardGreeting.tsx +23 -0
  177. package/src/components/dashboard/DashboardSkeleton.tsx +35 -0
  178. package/src/components/dashboard/QuickActions.tsx +52 -0
  179. package/src/components/dashboard/TopEntitiesTable.tsx +63 -0
  180. package/src/components/data/ComplianceMetrics.test.tsx +32 -0
  181. package/src/components/data/ComplianceMetrics.tsx +40 -0
  182. package/src/components/data/ConfidenceScore.test.tsx +62 -0
  183. package/src/components/data/ConfidenceScore.tsx +27 -0
  184. package/src/components/data/StatCard.test.tsx +72 -0
  185. package/src/components/data/StatCard.tsx +63 -0
  186. package/src/components/data/StatusBadge.test.tsx +63 -0
  187. package/src/components/data/StatusBadge.tsx +39 -0
  188. package/src/components/layout/AppShell.tsx +48 -0
  189. package/src/components/layout/Breadcrumbs.tsx +48 -0
  190. package/src/components/layout/CommandPalette.tsx +81 -0
  191. package/src/components/layout/DashboardLayout.tsx +19 -0
  192. package/src/components/layout/MobileHeader.tsx +30 -0
  193. package/src/components/layout/NavGroup.test.tsx +63 -0
  194. package/src/components/layout/NavGroup.tsx +64 -0
  195. package/src/components/layout/NotificationBell.tsx +89 -0
  196. package/src/components/layout/PageHeader.test.tsx +61 -0
  197. package/src/components/layout/PageHeader.tsx +19 -0
  198. package/src/components/layout/ProtectedRoute.tsx +31 -0
  199. package/src/components/layout/PublicLayout.tsx +17 -0
  200. package/src/components/layout/Sidebar.test.tsx +67 -0
  201. package/src/components/layout/Sidebar.tsx +92 -0
  202. package/src/components/layout/Toolbar.test.tsx +47 -0
  203. package/src/components/layout/Toolbar.tsx +68 -0
  204. package/src/components/layout/navItems.ts +94 -0
  205. package/src/components/lists/ListCard.tsx +78 -0
  206. package/src/components/lists/ListMarketplaceCard.tsx +77 -0
  207. package/src/components/screening/CircularConfidence.tsx +38 -0
  208. package/src/components/screening/LimitReachedBanner.tsx +31 -0
  209. package/src/components/screening/ListSelector.tsx +64 -0
  210. package/src/components/screening/MatchDetailHeader.tsx +64 -0
  211. package/src/components/screening/MatchEntityInfo.tsx +56 -0
  212. package/src/components/screening/MatchEvidenceBars.tsx +65 -0
  213. package/src/components/screening/MatchMetadata.tsx +95 -0
  214. package/src/components/screening/ScreenResults.tsx +49 -0
  215. package/src/components/screening/ScreeningForm.test.tsx +83 -0
  216. package/src/components/screening/ScreeningForm.tsx +100 -0
  217. package/src/components/screening/ScreeningLayersList.test.tsx +33 -0
  218. package/src/components/screening/ScreeningLayersList.tsx +46 -0
  219. package/src/components/screening/ScreeningProgress.tsx +91 -0
  220. package/src/components/screening/ScreeningQuotaBanner.tsx +64 -0
  221. package/src/components/screening/ScreeningResultCard.tsx +47 -0
  222. package/src/components/screening/ScreeningResultRow.tsx +45 -0
  223. package/src/components/screening/ScreeningResults.test.tsx +37 -0
  224. package/src/components/screening/ScreeningResults.tsx +33 -0
  225. package/src/components/screening/ShareResults.tsx +103 -0
  226. package/src/components/screening/ThresholdSlider.tsx +23 -0
  227. package/src/components/transactions/WebhookCTA.tsx +63 -0
  228. package/src/components/ui/Avatar.test.tsx +47 -0
  229. package/src/components/ui/Avatar.tsx +35 -0
  230. package/src/components/ui/Badge.test.tsx +49 -0
  231. package/src/components/ui/Badge.tsx +33 -0
  232. package/src/components/ui/Button.test.tsx +56 -0
  233. package/src/components/ui/Button.tsx +46 -0
  234. package/src/components/ui/Card.test.tsx +61 -0
  235. package/src/components/ui/Card.tsx +29 -0
  236. package/src/components/ui/ConfirmModal.tsx +67 -0
  237. package/src/components/ui/Divider.test.tsx +24 -0
  238. package/src/components/ui/Divider.tsx +5 -0
  239. package/src/components/ui/EmptyState.test.tsx +49 -0
  240. package/src/components/ui/EmptyState.tsx +22 -0
  241. package/src/components/ui/ErrorBoundary.tsx +44 -0
  242. package/src/components/ui/ExportMenu.tsx +71 -0
  243. package/src/components/ui/LanguageSwitcher.tsx +37 -0
  244. package/src/components/ui/LoadingSpinner.test.tsx +41 -0
  245. package/src/components/ui/LoadingSpinner.tsx +21 -0
  246. package/src/components/ui/MetricCard.tsx +63 -0
  247. package/src/components/ui/ScoreRing.tsx +51 -0
  248. package/src/components/ui/SearchField.test.tsx +55 -0
  249. package/src/components/ui/SearchField.tsx +31 -0
  250. package/src/components/ui/SeverityBadge.tsx +57 -0
  251. package/src/components/ui/ThemeToggle.tsx +37 -0
  252. package/src/components/ui/Toast.test.tsx +79 -0
  253. package/src/components/ui/Toast.tsx +75 -0
  254. package/src/components/ui/Toggle.test.tsx +85 -0
  255. package/src/components/ui/Toggle.tsx +46 -0
  256. package/src/context/AuthContext.tsx +71 -0
  257. package/src/data/pepProfiles.ts +76 -0
  258. package/src/data/pepProfilesExtra.ts +58 -0
  259. package/src/hooks/useAlerts.ts +36 -0
  260. package/src/hooks/useAnalytics.ts +23 -0
  261. package/src/hooks/useApi.test.ts +79 -0
  262. package/src/hooks/useApi.ts +33 -0
  263. package/src/hooks/useAudit.ts +28 -0
  264. package/src/hooks/useBilling.ts +38 -0
  265. package/src/hooks/useConfig.ts +35 -0
  266. package/src/hooks/useDebounce.test.ts +84 -0
  267. package/src/hooks/useDebounce.ts +15 -0
  268. package/src/hooks/useDirection.ts +15 -0
  269. package/src/hooks/useLists.ts +34 -0
  270. package/src/hooks/useMediaQuery.test.ts +97 -0
  271. package/src/hooks/useMediaQuery.ts +28 -0
  272. package/src/hooks/useScreening.ts +33 -0
  273. package/src/hooks/useSidebar.ts +18 -0
  274. package/src/hooks/useUsage.ts +27 -0
  275. package/src/i18n/config.ts +33 -0
  276. package/src/i18n/locales/ar/admin.json +19 -0
  277. package/src/i18n/locales/ar/alerts.json +52 -0
  278. package/src/i18n/locales/ar/analytics.json +9 -0
  279. package/src/i18n/locales/ar/audit.json +12 -0
  280. package/src/i18n/locales/ar/auth.json +60 -0
  281. package/src/i18n/locales/ar/batch.json +5 -0
  282. package/src/i18n/locales/ar/billing.json +41 -0
  283. package/src/i18n/locales/ar/common.json +65 -0
  284. package/src/i18n/locales/ar/compliance.json +83 -0
  285. package/src/i18n/locales/ar/config.json +13 -0
  286. package/src/i18n/locales/ar/dashboard.json +19 -0
  287. package/src/i18n/locales/ar/errors.json +9 -0
  288. package/src/i18n/locales/ar/index.ts +29 -0
  289. package/src/i18n/locales/ar/legal.json +10 -0
  290. package/src/i18n/locales/ar/lists.json +6 -0
  291. package/src/i18n/locales/ar/marketing.json +110 -0
  292. package/src/i18n/locales/ar/monitoring.json +15 -0
  293. package/src/i18n/locales/ar/nav.json +35 -0
  294. package/src/i18n/locales/ar/onboarding.json +25 -0
  295. package/src/i18n/locales/ar/platform.json +23 -0
  296. package/src/i18n/locales/ar/screening.json +26 -0
  297. package/src/i18n/locales/ar/team.json +11 -0
  298. package/src/i18n/locales/en/admin.json +21 -0
  299. package/src/i18n/locales/en/alerts.json +52 -0
  300. package/src/i18n/locales/en/analytics.json +9 -0
  301. package/src/i18n/locales/en/audit.json +12 -0
  302. package/src/i18n/locales/en/auth.json +60 -0
  303. package/src/i18n/locales/en/batch.json +5 -0
  304. package/src/i18n/locales/en/billing.json +87 -0
  305. package/src/i18n/locales/en/common.json +65 -0
  306. package/src/i18n/locales/en/compliance.json +83 -0
  307. package/src/i18n/locales/en/config.json +29 -0
  308. package/src/i18n/locales/en/dashboard.json +23 -0
  309. package/src/i18n/locales/en/errors.json +9 -0
  310. package/src/i18n/locales/en/index.ts +29 -0
  311. package/src/i18n/locales/en/legal.json +114 -0
  312. package/src/i18n/locales/en/lists.json +6 -0
  313. package/src/i18n/locales/en/marketing.json +174 -0
  314. package/src/i18n/locales/en/monitoring.json +15 -0
  315. package/src/i18n/locales/en/nav.json +35 -0
  316. package/src/i18n/locales/en/onboarding.json +31 -0
  317. package/src/i18n/locales/en/platform.json +25 -0
  318. package/src/i18n/locales/en/screening.json +26 -0
  319. package/src/i18n/locales/en/team.json +12 -0
  320. package/src/i18n/locales/he/admin.json +19 -0
  321. package/src/i18n/locales/he/alerts.json +52 -0
  322. package/src/i18n/locales/he/analytics.json +9 -0
  323. package/src/i18n/locales/he/audit.json +12 -0
  324. package/src/i18n/locales/he/auth.json +60 -0
  325. package/src/i18n/locales/he/batch.json +5 -0
  326. package/src/i18n/locales/he/billing.json +41 -0
  327. package/src/i18n/locales/he/common.json +65 -0
  328. package/src/i18n/locales/he/compliance.json +83 -0
  329. package/src/i18n/locales/he/config.json +13 -0
  330. package/src/i18n/locales/he/dashboard.json +19 -0
  331. package/src/i18n/locales/he/errors.json +9 -0
  332. package/src/i18n/locales/he/index.ts +29 -0
  333. package/src/i18n/locales/he/legal.json +10 -0
  334. package/src/i18n/locales/he/lists.json +6 -0
  335. package/src/i18n/locales/he/marketing.json +110 -0
  336. package/src/i18n/locales/he/monitoring.json +15 -0
  337. package/src/i18n/locales/he/nav.json +35 -0
  338. package/src/i18n/locales/he/onboarding.json +25 -0
  339. package/src/i18n/locales/he/platform.json +23 -0
  340. package/src/i18n/locales/he/screening.json +26 -0
  341. package/src/i18n/locales/he/team.json +11 -0
  342. package/src/index.css +112 -0
  343. package/src/main.tsx +15 -0
  344. package/src/pages/APIKeys.tsx +120 -0
  345. package/src/pages/AddMonitorModal.tsx +30 -0
  346. package/src/pages/AdverseMedia.test.tsx +18 -0
  347. package/src/pages/AdverseMedia.tsx +89 -0
  348. package/src/pages/AlertDetailPage.tsx +64 -0
  349. package/src/pages/AlertQueue.test.tsx +48 -0
  350. package/src/pages/AlertQueue.tsx +63 -0
  351. package/src/pages/Analytics.tsx +50 -0
  352. package/src/pages/AuditTrail.tsx +64 -0
  353. package/src/pages/BatchJobs.tsx +79 -0
  354. package/src/pages/CaseDetail.tsx +72 -0
  355. package/src/pages/CaseManagement.test.tsx +31 -0
  356. package/src/pages/CaseManagement.tsx +92 -0
  357. package/src/pages/Configuration.test.tsx +96 -0
  358. package/src/pages/Configuration.tsx +123 -0
  359. package/src/pages/CryptoScreening.tsx +109 -0
  360. package/src/pages/Dashboard.test.tsx +51 -0
  361. package/src/pages/Dashboard.tsx +66 -0
  362. package/src/pages/EDDWorkflow.test.tsx +29 -0
  363. package/src/pages/EDDWorkflow.tsx +73 -0
  364. package/src/pages/ForgotPassword.test.tsx +49 -0
  365. package/src/pages/ForgotPassword.tsx +67 -0
  366. package/src/pages/ListsMarketplace.tsx +102 -0
  367. package/src/pages/Login.test.tsx +100 -0
  368. package/src/pages/Login.tsx +57 -0
  369. package/src/pages/MFASetup.tsx +114 -0
  370. package/src/pages/MonitorProfileCard.tsx +27 -0
  371. package/src/pages/Monitoring.tsx +68 -0
  372. package/src/pages/Onboarding.test.tsx +36 -0
  373. package/src/pages/Onboarding.tsx +60 -0
  374. package/src/pages/PEPScreening.test.tsx +15 -0
  375. package/src/pages/PEPScreening.tsx +100 -0
  376. package/src/pages/ResetPassword.tsx +81 -0
  377. package/src/pages/RiskAssessment.test.tsx +15 -0
  378. package/src/pages/RiskAssessment.tsx +108 -0
  379. package/src/pages/SanctionsLists.tsx +74 -0
  380. package/src/pages/ScreenEntity.test.tsx +82 -0
  381. package/src/pages/ScreenEntity.tsx +76 -0
  382. package/src/pages/Signup.test.tsx +98 -0
  383. package/src/pages/Signup.tsx +92 -0
  384. package/src/pages/TaskHistory.tsx +183 -0
  385. package/src/pages/Team.test.tsx +15 -0
  386. package/src/pages/Team.tsx +140 -0
  387. package/src/pages/TransactionMonitoring.test.tsx +18 -0
  388. package/src/pages/TransactionMonitoring.tsx +118 -0
  389. package/src/pages/TxnScreening.tsx +125 -0
  390. package/src/pages/UBOChain.test.tsx +35 -0
  391. package/src/pages/UBOChain.tsx +65 -0
  392. package/src/pages/Webhooks.tsx +137 -0
  393. package/src/pages/admin/DataSources.tsx +230 -0
  394. package/src/pages/admin/Operations.tsx +103 -0
  395. package/src/pages/admin/ScheduledTasks.tsx +155 -0
  396. package/src/pages/admin/SystemHealth.tsx +58 -0
  397. package/src/pages/admin/TenantDetail.tsx +62 -0
  398. package/src/pages/admin/Tenants.test.tsx +20 -0
  399. package/src/pages/admin/Tenants.tsx +63 -0
  400. package/src/pages/admin/opsRunners.ts +81 -0
  401. package/src/pages/admin/opsTerminal.tsx +63 -0
  402. package/src/pages/billing/ActiveSubscriptions.tsx +41 -0
  403. package/src/pages/billing/AddProductModal.tsx +99 -0
  404. package/src/pages/billing/BillingPage.test.tsx +30 -0
  405. package/src/pages/billing/BillingPage.tsx +67 -0
  406. package/src/pages/billing/CurrentPlan.tsx +50 -0
  407. package/src/pages/billing/InvoiceList.tsx +104 -0
  408. package/src/pages/billing/InvoiceRow.tsx +37 -0
  409. package/src/pages/billing/LemonSqueezySetup.tsx +51 -0
  410. package/src/pages/billing/PaymentAlert.tsx +33 -0
  411. package/src/pages/billing/PlanComparison.tsx +53 -0
  412. package/src/pages/billing/ProductUsage.tsx +43 -0
  413. package/src/pages/billing/PromoCodeInput.tsx +58 -0
  414. package/src/pages/billing/SeatManager.tsx +80 -0
  415. package/src/pages/billing/SeatRow.tsx +32 -0
  416. package/src/pages/billing/SubscriptionCard.tsx +73 -0
  417. package/src/pages/billing/UpgradeModal.tsx +53 -0
  418. package/src/pages/billing/UsageHistory.tsx +37 -0
  419. package/src/pages/billing/UsageMeter.tsx +26 -0
  420. package/src/pages/billing/UsageOverview.tsx +38 -0
  421. package/src/pages/legal/PrivacyPolicy.tsx +25 -0
  422. package/src/pages/legal/TermsOfService.tsx +25 -0
  423. package/src/pages/marketing/BundleCallout.tsx +24 -0
  424. package/src/pages/marketing/CTASection.tsx +48 -0
  425. package/src/pages/marketing/CaseStudy.tsx +37 -0
  426. package/src/pages/marketing/ComparisonTable.tsx +66 -0
  427. package/src/pages/marketing/CompetitiveEdge.tsx +55 -0
  428. package/src/pages/marketing/DataCoverage.tsx +54 -0
  429. package/src/pages/marketing/DataRain.tsx +30 -0
  430. package/src/pages/marketing/EnterpriseCTA.tsx +26 -0
  431. package/src/pages/marketing/FAQItem.tsx +27 -0
  432. package/src/pages/marketing/FAQSchema.tsx +43 -0
  433. package/src/pages/marketing/FAQSection.tsx +19 -0
  434. package/src/pages/marketing/FeatureDetail.tsx +19 -0
  435. package/src/pages/marketing/FeaturesGrid.tsx +60 -0
  436. package/src/pages/marketing/FeaturesSpotlight.tsx +68 -0
  437. package/src/pages/marketing/FooterSection.tsx +92 -0
  438. package/src/pages/marketing/GradientOrbs.tsx +26 -0
  439. package/src/pages/marketing/HeroSearch.tsx +113 -0
  440. package/src/pages/marketing/HeroSection.tsx +72 -0
  441. package/src/pages/marketing/LandingPage.tsx +45 -0
  442. package/src/pages/marketing/LogoCloud.tsx +31 -0
  443. package/src/pages/marketing/LogoMarquee.tsx +45 -0
  444. package/src/pages/marketing/MarketingNav.tsx +80 -0
  445. package/src/pages/marketing/MatchingLayers.tsx +78 -0
  446. package/src/pages/marketing/MobileMenu.tsx +45 -0
  447. package/src/pages/marketing/PricingCard.tsx +57 -0
  448. package/src/pages/marketing/PricingFeatureRow.tsx +16 -0
  449. package/src/pages/marketing/PricingSection.tsx +103 -0
  450. package/src/pages/marketing/PricingToggle.tsx +40 -0
  451. package/src/pages/marketing/ProductPricingCards.tsx +23 -0
  452. package/src/pages/marketing/ProductShowcase.tsx +81 -0
  453. package/src/pages/marketing/ProductTabs.tsx +45 -0
  454. package/src/pages/marketing/QuoteRotator.tsx +56 -0
  455. package/src/pages/marketing/StatsBar.tsx +81 -0
  456. package/src/pages/marketing/StatsSection.tsx +44 -0
  457. package/src/pages/marketing/TestimonialCard.tsx +38 -0
  458. package/src/pages/marketing/TestimonialsSection.tsx +32 -0
  459. package/src/pages/marketing/animations.tsx +56 -0
  460. package/src/pages/onboarding/CountryStep.tsx +38 -0
  461. package/src/pages/onboarding/ListsStep.tsx +44 -0
  462. package/src/pages/onboarding/StepIndicator.tsx +34 -0
  463. package/src/pages/onboarding/ThresholdStep.tsx +49 -0
  464. package/src/pages/platform/APIKeys.tsx +102 -0
  465. package/src/pages/platform/Overview.tsx +58 -0
  466. package/src/pages/platform/Users.tsx +110 -0
  467. package/src/pages/reporting/ComplianceReport.tsx +99 -0
  468. package/src/pages/reporting/SARForm.tsx +99 -0
  469. package/src/routes/appRoutes.tsx +60 -0
  470. package/src/routes/compliance.tsx +28 -0
  471. package/src/routes/lazyCompliance.ts +34 -0
  472. package/src/routes/lazyPages.ts +35 -0
  473. package/src/routes/lazyPlatform.ts +5 -0
  474. package/src/routes/platform.tsx +15 -0
  475. package/src/styles/effects.css +76 -0
  476. package/src/test/setup.ts +25 -0
  477. package/src/test/utils.tsx +49 -0
  478. package/src/types/alert.ts +31 -0
  479. package/src/types/analytics.ts +16 -0
  480. package/src/types/audit.ts +11 -0
  481. package/src/types/billing.ts +60 -0
  482. package/src/types/common.ts +15 -0
  483. package/src/types/config.ts +19 -0
  484. package/src/types/entity.ts +34 -0
  485. package/src/types/index.ts +8 -0
  486. package/src/types/list.ts +15 -0
  487. package/src/types/screening.ts +32 -0
  488. package/src/vite-env.d.ts +1 -0
  489. package/tailwind.config.js +65 -0
  490. package/tsconfig.json +22 -0
  491. package/vite.config.ts +11 -0
  492. package/vitest.config.ts +19 -0
@@ -0,0 +1,72 @@
1
+ import { useState, useEffect } from 'react'
2
+ import { useParams } from 'react-router-dom'
3
+ import { useTranslation } from 'react-i18next'
4
+ import { api } from '../api/client'
5
+ import { CaseTimeline } from '../components/compliance/CaseTimeline'
6
+ import { CaseActions } from '../components/compliance/CaseActions'
7
+
8
+ interface CaseData {
9
+ id: string
10
+ entity_name: string
11
+ matched_name: string
12
+ status: string
13
+ priority: string
14
+ assigned_to: string
15
+ confidence: number
16
+ resolution: string
17
+ }
18
+
19
+ interface Comment {
20
+ id: string
21
+ content: string
22
+ created_at: string
23
+ }
24
+
25
+ export function CaseDetail() {
26
+ const { t } = useTranslation('compliance')
27
+ const { id } = useParams<{ id: string }>()
28
+ const [caseData, setCaseData] = useState<CaseData | null>(null)
29
+ const [comments, setComments] = useState<Comment[]>([])
30
+ const [validTransitions, setValidTransitions] = useState<string[]>([])
31
+
32
+ const fetchCase = () => {
33
+ api.get<{ case: CaseData; comments: Comment[] }>(`/cases/${id}`)
34
+ .then(d => {
35
+ setCaseData(d?.case ?? null)
36
+ setComments(d?.comments ?? [])
37
+ })
38
+ .catch(() => setCaseData(null))
39
+ api.get<{ valid_transitions: string[] }>(`/cases/${id}/timeline`)
40
+ .then(d => setValidTransitions(d?.valid_transitions ?? []))
41
+ .catch(() => {})
42
+ }
43
+
44
+ useEffect(() => { fetchCase() }, [id])
45
+
46
+ if (!caseData) return <div className="p-lg" role="status" aria-live="polite">Loading...</div>
47
+
48
+ return (
49
+ <div className="px-md py-lg sm:p-8 max-w-4xl mx-auto">
50
+ <h1 className="text-xl sm:text-2xl font-semibold mb-2">{caseData.entity_name}</h1>
51
+ <p className="text-apple-label-secondary mb-6 text-sm sm:text-base break-words">{t('case_detail.match')} {caseData.matched_name}</p>
52
+ <div className="grid grid-cols-1 sm:grid-cols-2 gap-4 mb-6">
53
+ <InfoField label={t('case_detail.status')} value={caseData.status} />
54
+ <InfoField label={t('case_detail.priority')} value={caseData.priority} />
55
+ <InfoField label={t('case_detail.confidence')} value={`${(caseData.confidence * 100).toFixed(1)}%`} />
56
+ <InfoField label={t('case_detail.assigned_to')} value={caseData.assigned_to || t('case_detail.unassigned')} />
57
+ </div>
58
+ <CaseActions caseId={id!} status={caseData.status}
59
+ validTransitions={validTransitions} onAction={fetchCase} />
60
+ <CaseTimeline caseId={id!} comments={comments} />
61
+ </div>
62
+ )
63
+ }
64
+
65
+ function InfoField({ label, value }: { label: string; value: string }) {
66
+ return (
67
+ <div>
68
+ <p className="text-xs text-apple-label-secondary">{label}</p>
69
+ <p className="font-medium">{value}</p>
70
+ </div>
71
+ )
72
+ }
@@ -0,0 +1,31 @@
1
+ import { render, screen } from '@testing-library/react'
2
+ import { describe, it, expect, vi, beforeEach } from 'vitest'
3
+ import { CaseManagement } from './CaseManagement'
4
+
5
+ beforeEach(() => {
6
+ global.fetch = vi.fn(() =>
7
+ Promise.resolve({
8
+ json: () => Promise.resolve({ data: { cases: [] } }),
9
+ })
10
+ ) as any
11
+ })
12
+
13
+ describe('CaseManagement', () => {
14
+ it('renders title', () => {
15
+ render(<CaseManagement />)
16
+ expect(screen.getByText('Case Management')).toBeInTheDocument()
17
+ })
18
+
19
+ it('renders filter buttons', () => {
20
+ render(<CaseManagement />)
21
+ expect(screen.getByText('All')).toBeInTheDocument()
22
+ expect(screen.getByText('open')).toBeInTheDocument()
23
+ expect(screen.getByText('escalated')).toBeInTheDocument()
24
+ })
25
+
26
+ it('shows empty state when no cases', async () => {
27
+ render(<CaseManagement />)
28
+ const empty = await screen.findByText('No cases found')
29
+ expect(empty).toBeInTheDocument()
30
+ })
31
+ })
@@ -0,0 +1,92 @@
1
+ import { useState, useEffect } from 'react'
2
+ import { useTranslation } from 'react-i18next'
3
+ import { PageHeader } from '../components/layout/PageHeader'
4
+ import { Card } from '../components/ui/Card'
5
+ import { LoadingSpinner } from '../components/ui/LoadingSpinner'
6
+ import { EmptyState } from '../components/ui/EmptyState'
7
+ import { api } from '../api/client'
8
+
9
+ interface ComplianceCase {
10
+ id: string
11
+ entity_name: string
12
+ matched_name: string
13
+ status: string
14
+ priority: string
15
+ assigned_to: string
16
+ created_at: string
17
+ }
18
+
19
+ export function CaseManagement() {
20
+ const { t } = useTranslation('compliance')
21
+ const [cases, setCases] = useState<ComplianceCase[]>([])
22
+ const [filter, setFilter] = useState('')
23
+ const [loading, setLoading] = useState(true)
24
+ const [error, setError] = useState('')
25
+
26
+ useEffect(() => {
27
+ setLoading(true)
28
+ setError('')
29
+ const ep = filter ? `/cases?status=${filter}` : '/cases'
30
+ api.get<{ cases: ComplianceCase[] }>(ep)
31
+ .then(d => setCases(d?.cases ?? []))
32
+ .catch(err => setError(err instanceof Error ? err.message : 'Failed to load cases'))
33
+ .finally(() => setLoading(false))
34
+ }, [filter])
35
+
36
+ const statuses = ['', 'open', 'in_review', 'escalated', 'resolved']
37
+
38
+ return (
39
+ <div className="max-w-6xl mx-auto">
40
+ <PageHeader title={t('cases.title')} description="Manage compliance investigation cases" />
41
+ <div className="flex gap-sm mb-lg flex-wrap">
42
+ {statuses.map(s => (
43
+ <button key={s} onClick={() => setFilter(s)} aria-pressed={filter === s}
44
+ className={`px-lg py-xs rounded-full text-sm cursor-pointer transition-colors ${
45
+ filter === s ? 'bg-apple-blue text-white' : 'bg-white/[0.04] text-apple-label-secondary hover:bg-white/[0.08]'
46
+ }`}>
47
+ {s ? t(`cases.${s}`) : t('cases.all')}
48
+ </button>
49
+ ))}
50
+ </div>
51
+
52
+ {error && <Card className="mb-lg"><p role="alert" className="text-apple-red sf-body">{error}</p></Card>}
53
+ {loading && <LoadingSpinner />}
54
+ {!loading && cases.length === 0 && <EmptyState title={t('cases.no_cases')} />}
55
+
56
+ {!loading && cases.length > 0 && (
57
+ <div className="space-y-sm">
58
+ {cases.map(c => <CaseCard key={c.id} caseItem={c} t={t} />)}
59
+ </div>
60
+ )}
61
+ </div>
62
+ )
63
+ }
64
+
65
+ function CaseCard({ caseItem, t }: { caseItem: ComplianceCase; t: (k: string) => string }) {
66
+ const priorityColor: Record<string, string> = {
67
+ critical: 'bg-apple-red/20 text-apple-red',
68
+ high: 'bg-apple-orange/20 text-apple-orange',
69
+ medium: 'bg-apple-yellow/20 text-apple-yellow',
70
+ low: 'bg-apple-green/20 text-apple-green',
71
+ }
72
+ return (
73
+ <a href={`/compliance/cases/${caseItem.id}`}
74
+ className="block card-vibrancy p-lg hover:bg-white/[0.04] cursor-pointer transition-colors rounded-apple-lg">
75
+ <div className="flex justify-between items-start">
76
+ <div>
77
+ <p className="sf-headline">{caseItem.entity_name}</p>
78
+ <p className="sf-caption text-white/50">{t('cases.matched')} {caseItem.matched_name}</p>
79
+ <p className="sf-caption text-white/30 mt-xs">{new Date(caseItem.created_at).toLocaleDateString()}</p>
80
+ </div>
81
+ <div className="flex gap-sm">
82
+ <span className={`px-2 py-0.5 text-xs rounded-full ${priorityColor[caseItem.priority] || 'bg-white/5'}`}>
83
+ {caseItem.priority}
84
+ </span>
85
+ <span className="px-2 py-0.5 text-xs rounded-full bg-white/[0.06] text-white/60">
86
+ {caseItem.status}
87
+ </span>
88
+ </div>
89
+ </div>
90
+ </a>
91
+ )
92
+ }
@@ -0,0 +1,96 @@
1
+ import { render, screen, waitFor } from '@testing-library/react'
2
+ import userEvent from '@testing-library/user-event'
3
+ import { describe, it, expect, vi, beforeEach } from 'vitest'
4
+ import { Configuration } from './Configuration'
5
+
6
+ const mockConfig = {
7
+ default_threshold: 0.7,
8
+ auto_dismiss_below: 0.3,
9
+ auto_escalate_above: 0.9,
10
+ enabled_lists: [
11
+ { list_id: 'OFAC_SDN', sync_schedule: 'daily' },
12
+ ],
13
+ }
14
+
15
+ const mockUpdateConfig = vi.fn().mockResolvedValue(mockConfig)
16
+
17
+ vi.mock('../hooks/useConfig', () => ({
18
+ useConfig: () => ({
19
+ config: mockConfig,
20
+ loading: false,
21
+ error: null,
22
+ updateConfig: mockUpdateConfig,
23
+ refetch: vi.fn(),
24
+ }),
25
+ }))
26
+
27
+ describe('Configuration', () => {
28
+ beforeEach(() => { mockUpdateConfig.mockClear() })
29
+
30
+ it('renders page title', () => {
31
+ render(<Configuration />)
32
+ expect(screen.getByText('Configuration')).toBeInTheDocument()
33
+ })
34
+
35
+ it('renders page description', () => {
36
+ render(<Configuration />)
37
+ expect(screen.getByText(/screening parameters/i)).toBeInTheDocument()
38
+ })
39
+
40
+ it('renders thresholds card', () => {
41
+ render(<Configuration />)
42
+ expect(screen.getByText('Thresholds')).toBeInTheDocument()
43
+ })
44
+
45
+ it('renders threshold sliders', () => {
46
+ const { container } = render(<Configuration />)
47
+ const sliders = container.querySelectorAll('input[type="range"]')
48
+ expect(sliders.length).toBe(3)
49
+ })
50
+
51
+ it('displays initial threshold percentages', () => {
52
+ render(<Configuration />)
53
+ expect(screen.getByText(/70%/)).toBeInTheDocument()
54
+ expect(screen.getByText(/30%/)).toBeInTheDocument()
55
+ expect(screen.getByText(/90%/)).toBeInTheDocument()
56
+ })
57
+
58
+ it('renders lists section', () => {
59
+ render(<Configuration />)
60
+ expect(screen.getByText(/Lists/)).toBeInTheDocument()
61
+ expect(screen.getByText('OFAC_SDN')).toBeInTheDocument()
62
+ })
63
+
64
+ it('renders save button', () => {
65
+ render(<Configuration />)
66
+ expect(
67
+ screen.getByRole('button', { name: /save changes/i }),
68
+ ).toBeInTheDocument()
69
+ })
70
+
71
+ it('calls updateConfig on save', async () => {
72
+ render(<Configuration />)
73
+ await userEvent.click(
74
+ screen.getByRole('button', { name: /save changes/i }),
75
+ )
76
+ await waitFor(() => {
77
+ expect(mockUpdateConfig).toHaveBeenCalledTimes(1)
78
+ })
79
+ })
80
+
81
+ it('shows threshold labels', () => {
82
+ render(<Configuration />)
83
+ expect(screen.getByText(/Default Match Threshold/)).toBeInTheDocument()
84
+ expect(screen.getByText(/Auto-Dismiss Below/)).toBeInTheDocument()
85
+ expect(screen.getByText(/Auto-Escalate Above/)).toBeInTheDocument()
86
+ })
87
+
88
+ it('allows threshold adjustment via slider', async () => {
89
+ const { container } = render(<Configuration />)
90
+ const slider = container.querySelector(
91
+ 'input[type="range"]',
92
+ ) as HTMLInputElement
93
+ expect(slider).toBeTruthy()
94
+ expect(slider.value).toBe('70')
95
+ })
96
+ })
@@ -0,0 +1,123 @@
1
+ import React, { useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { Link } from 'react-router-dom';
4
+ import { Shield, Plus, Check, Clock } from 'lucide-react';
5
+ import { PageHeader } from '../components/layout/PageHeader';
6
+ import { Button } from '../components/ui/Button';
7
+ import { useConfig } from '../hooks/useConfig';
8
+ import { LoadingSpinner } from '../components/ui/LoadingSpinner';
9
+ import type { ListConfigItem } from '../api/config';
10
+
11
+ export function Configuration() {
12
+ const { t } = useTranslation('config');
13
+ const { config, loading, error, updateConfig } = useConfig();
14
+ const [saving, setSaving] = useState(false);
15
+ const [threshold, setThreshold] = useState<number | null>(null);
16
+ const [dismissBelow, setDismissBelow] = useState<number | null>(null);
17
+ const [escalateAbove, setEscalateAbove] = useState<number | null>(null);
18
+
19
+ if (loading || !config) {
20
+ return <div className="flex items-center justify-center h-96"><LoadingSpinner /></div>;
21
+ }
22
+
23
+ const th = threshold ?? config.default_threshold * 100;
24
+ const d = dismissBelow ?? config.auto_dismiss_below * 100;
25
+ const ea = escalateAbove ?? config.auto_escalate_above * 100;
26
+ const lists = config.enabled_lists ?? [];
27
+
28
+ const handleSave = async () => {
29
+ setSaving(true);
30
+ try {
31
+ await updateConfig({ default_threshold: th / 100, auto_dismiss_below: d / 100, auto_escalate_above: ea / 100 });
32
+ } finally { setSaving(false); }
33
+ };
34
+
35
+ return (
36
+ <div className="space-y-lg">
37
+ <PageHeader title={t('title')} description={t('description')} />
38
+ {error && <p className="text-apple-red sf-caption mb-md" role="alert">{error.message}</p>}
39
+ <div className="max-w-2xl space-y-lg">
40
+ <ThresholdsPanel th={th} d={d} ea={ea} t={t}
41
+ onThreshold={setThreshold} onDismiss={setDismissBelow} onEscalate={setEscalateAbove} />
42
+ <ListsPanel lists={lists} t={t} />
43
+ <Button variant="primary" onClick={handleSave} disabled={saving}>
44
+ {saving ? t('saving') : t('save')}
45
+ </Button>
46
+ </div>
47
+ </div>
48
+ );
49
+ }
50
+
51
+ function ThresholdsPanel({ th, d, ea, t, onThreshold, onDismiss, onEscalate }: {
52
+ th: number; d: number; ea: number; t: (k: string) => string;
53
+ onThreshold: (v: number) => void; onDismiss: (v: number) => void; onEscalate: (v: number) => void;
54
+ }) {
55
+ return (
56
+ <div className="glass-panel rounded-apple-lg p-xl">
57
+ <h3 className="sf-headline mb-md gradient-text">{t('thresholds.title')}</h3>
58
+ <SliderField label={`${t('thresholds.default')} ${th}%`} value={th} onChange={onThreshold} color="accent-apple-blue" />
59
+ <SliderField label={`${t('thresholds.auto_dismiss')} ${d}%`} value={d} onChange={onDismiss} color="accent-apple-green" />
60
+ <SliderField label={`${t('thresholds.auto_escalate')} ${ea}%`} value={ea} onChange={onEscalate} color="accent-apple-red" />
61
+ </div>
62
+ );
63
+ }
64
+
65
+ function SliderField({ label, value, onChange, color }: {
66
+ label: string; value: number; onChange: (v: number) => void; color: string;
67
+ }) {
68
+ return (
69
+ <label className="block mb-md">
70
+ <span className="sf-caption">{label}</span>
71
+ <input type="range" min="0" max="100" value={value} aria-valuetext={`${value}%`}
72
+ aria-label={label} onChange={(e) => onChange(Number(e.target.value))}
73
+ className={`w-full ${color}`} />
74
+ <div className="flex justify-between text-xs text-zinc-500 mt-1">
75
+ <span>0%</span><span>100%</span>
76
+ </div>
77
+ </label>
78
+ );
79
+ }
80
+
81
+ function ListsPanel({ lists, t }: { lists: ListConfigItem[]; t: (k: string) => string }) {
82
+ return (
83
+ <div className="glass-panel rounded-apple-lg p-xl">
84
+ <div className="flex items-center justify-between mb-md">
85
+ <h3 className="sf-headline gradient-text">{t('lists.title')} ({lists.length})</h3>
86
+ <Link to="/lists/marketplace"
87
+ className="flex items-center gap-xs text-apple-blue text-[13px] font-semibold hover:underline">
88
+ <Plus className="w-4 h-4" /> Add Lists
89
+ </Link>
90
+ </div>
91
+ {lists.length === 0 ? <EmptyLists /> : lists.map((l) => <ListRow key={l.list_id} list={l} />)}
92
+ </div>
93
+ );
94
+ }
95
+
96
+ function EmptyLists() {
97
+ return (
98
+ <div className="text-center py-xl">
99
+ <Shield className="w-8 h-8 text-apple-label-tertiary mx-auto mb-sm" />
100
+ <p className="sf-body text-apple-label-secondary mb-sm">No lists enabled yet</p>
101
+ <Link to="/lists/marketplace" className="text-apple-blue text-[13px] font-semibold hover:underline">
102
+ Browse Marketplace
103
+ </Link>
104
+ </div>
105
+ );
106
+ }
107
+
108
+ function ListRow({ list }: { list: ListConfigItem }) {
109
+ return (
110
+ <div className="flex items-center justify-between py-sm border-b border-white/5 last:border-0">
111
+ <div className="flex items-center gap-sm">
112
+ <Shield className="w-4 h-4 text-apple-blue" />
113
+ <span className="sf-body">{list.list_id}</span>
114
+ </div>
115
+ <div className="flex items-center gap-md">
116
+ {list.sync_enabled && <Check className="w-3 h-3 text-apple-green" />}
117
+ <span className="sf-caption flex items-center gap-xs">
118
+ <Clock className="w-3 h-3" /> {list.sync_schedule || 'Manual'}
119
+ </span>
120
+ </div>
121
+ </div>
122
+ );
123
+ }
@@ -0,0 +1,109 @@
1
+ import { useState } from 'react'
2
+ import { PageHeader } from '../components/layout/PageHeader'
3
+ import { Card } from '../components/ui/Card'
4
+ import { Button } from '../components/ui/Button'
5
+ import { Badge } from '../components/ui/Badge'
6
+ import { LoadingSpinner } from '../components/ui/LoadingSpinner'
7
+ import { api } from '../api/client'
8
+
9
+ interface CryptoHit {
10
+ address: string; chain: string; entity_id: string;
11
+ list_id: string; source: string;
12
+ }
13
+ interface CryptoResult {
14
+ decision: string; wallet_address: string; chain: string;
15
+ hits: CryptoHit[]; risk_flags: string[]; processing_us: number;
16
+ }
17
+
18
+ export function CryptoScreening() {
19
+ const [address, setAddress] = useState('')
20
+ const [chain, setChain] = useState('ETH')
21
+ const [result, setResult] = useState<CryptoResult | null>(null)
22
+ const [loading, setLoading] = useState(false)
23
+ const [error, setError] = useState('')
24
+
25
+ const screen = async () => {
26
+ if (!address.trim()) return
27
+ setLoading(true); setError(''); setResult(null)
28
+ try {
29
+ const d = await api.post<CryptoResult>('/crypto/screen', {
30
+ wallet_address: address.trim(), chain,
31
+ })
32
+ setResult(d)
33
+ } catch (err) {
34
+ setError(err instanceof Error ? err.message : 'Screening failed')
35
+ } finally {
36
+ setLoading(false)
37
+ }
38
+ }
39
+
40
+ return (
41
+ <div>
42
+ <PageHeader title="Crypto Screening"
43
+ description="Screen wallet addresses against 13K+ sanctioned wallets" />
44
+ <Card className="mb-lg">
45
+ <div className="flex flex-col sm:flex-row gap-md mb-lg">
46
+ <input value={address} onChange={e => setAddress(e.target.value)}
47
+ placeholder="0x7d84d78bb9b6044a45fa08b7fe109f2c8648ab4e"
48
+ className="input-field flex-1 font-mono text-sm" />
49
+ <select value={chain} onChange={e => setChain(e.target.value)} className="input-field w-24">
50
+ <option value="ETH">ETH</option>
51
+ <option value="BTC">BTC</option>
52
+ <option value="TRX">TRX</option>
53
+ </select>
54
+ </div>
55
+ <Button onClick={screen} disabled={loading || !address.trim()} className="w-full">
56
+ {loading ? 'Scanning...' : 'Screen Wallet'}
57
+ </Button>
58
+ </Card>
59
+
60
+ {loading && <LoadingSpinner />}
61
+ {error && <Card><p role="alert" className="text-apple-red sf-body">{error}</p></Card>}
62
+
63
+ {result && (
64
+ <Card>
65
+ <div className="flex items-center justify-between mb-lg">
66
+ <div className="flex items-center gap-md">
67
+ <span className={`text-2xl font-bold ${result.decision === 'CLEAR' ? 'text-apple-green' : 'text-apple-red'}`}>
68
+ {result.decision}
69
+ </span>
70
+ <Badge color={result.decision === 'CLEAR' ? 'green' : 'red'} size="sm">{result.chain}</Badge>
71
+ </div>
72
+ <span className="sf-caption text-white/40">{result.processing_us ?? 0}μs</span>
73
+ </div>
74
+ <code className="text-sm text-white/60 font-mono block mb-lg break-all">{result.wallet_address}</code>
75
+
76
+ {(result.risk_flags ?? []).length > 0 && (
77
+ <div className="flex flex-wrap gap-sm mb-lg">
78
+ {(result.risk_flags ?? []).map(f => <Badge key={f} color="red" size="sm">{f}</Badge>)}
79
+ </div>
80
+ )}
81
+
82
+ {(result.hits ?? []).length > 0 && (
83
+ <div>
84
+ <p className="sf-caption text-white/50 mb-sm">Sanctions Matches</p>
85
+ {(result.hits ?? []).map((h, i) => (
86
+ <div key={i} className="p-md bg-apple-red/5 border border-apple-red/10 rounded-apple-md mb-sm">
87
+ <code className="text-sm text-white/80 font-mono break-all">{h.address}</code>
88
+ <div className="flex gap-sm mt-xs">
89
+ <Badge color="red" size="sm">{h.list_id}</Badge>
90
+ <Badge color="blue" size="sm">{h.chain}</Badge>
91
+ </div>
92
+ </div>
93
+ ))}
94
+ </div>
95
+ )}
96
+
97
+ {(result.hits ?? []).length === 0 && result.decision === 'CLEAR' && (
98
+ <div className="text-center py-lg">
99
+ <span className="text-3xl">✓</span>
100
+ <p className="sf-headline text-apple-green mt-sm">No sanctions matches</p>
101
+ </div>
102
+ )}
103
+ </Card>
104
+ )}
105
+ </div>
106
+ )
107
+ }
108
+
109
+ export default CryptoScreening
@@ -0,0 +1,51 @@
1
+ import { render, screen } from '@testing-library/react'
2
+ import { describe, it, expect, vi } from 'vitest'
3
+ import { Dashboard } from './Dashboard'
4
+
5
+ vi.mock('../context/AuthContext', () => ({
6
+ useAuth: () => ({
7
+ user: { id: '1', email: 'john@example.com', role: 'admin', tenant_id: 't1' },
8
+ loading: false,
9
+ isAuthenticated: true,
10
+ }),
11
+ }))
12
+
13
+ vi.mock('../hooks/useAnalytics', () => ({
14
+ useAnalytics: vi.fn(() => ({
15
+ analytics: {
16
+ totalAlerts: 42,
17
+ clearedAlerts: 28,
18
+ escalatedAlerts: 5,
19
+ avgResolutionTime: 2.5,
20
+ screeningVolume: [],
21
+ dispositionBreakdown: [],
22
+ riskDistribution: [],
23
+ topEntities: [
24
+ { name: 'Entity 1', alerts: 10, risk: 'High' },
25
+ { name: 'Entity 2', alerts: 8, risk: 'Medium' },
26
+ ],
27
+ },
28
+ loading: false,
29
+ error: null,
30
+ })),
31
+ }))
32
+
33
+ describe('Dashboard', () => {
34
+ it('renders page title', () => {
35
+ render(<Dashboard />)
36
+ expect(screen.getByRole('heading', { level: 1 })).toBeInTheDocument()
37
+ })
38
+
39
+ it('renders stat cards', () => {
40
+ render(<Dashboard />)
41
+ expect(screen.getByText('Total Alerts')).toBeInTheDocument()
42
+ expect(screen.getByText('Cleared Today')).toBeInTheDocument()
43
+ expect(screen.getByText('Escalated')).toBeInTheDocument()
44
+ })
45
+
46
+ it('displays stat card values', () => {
47
+ render(<Dashboard />)
48
+ expect(screen.getByText('42')).toBeInTheDocument()
49
+ expect(screen.getByText('28')).toBeInTheDocument()
50
+ })
51
+ })
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { StatCard } from '../components/data/StatCard';
4
+ import { AreaChartComponent } from '../components/charts/AreaChart';
5
+ import { DonutChart } from '../components/charts/DonutChart';
6
+ import { BarChartComponent } from '../components/charts/BarChart';
7
+ import { useAnalytics } from '../hooks/useAnalytics';
8
+ import { ComplianceMetrics } from '../components/data/ComplianceMetrics';
9
+ import { DashboardGreeting } from '../components/dashboard/DashboardGreeting';
10
+ import { DashboardSkeleton } from '../components/dashboard/DashboardSkeleton';
11
+ import { TopEntitiesTable } from '../components/dashboard/TopEntitiesTable';
12
+ import { ActivityFeed } from '../components/dashboard/ActivityFeed';
13
+ import { QuickActions } from '../components/dashboard/QuickActions';
14
+
15
+ export function Dashboard() {
16
+ const { t } = useTranslation('dashboard');
17
+ const { analytics, loading } = useAnalytics();
18
+
19
+ if (loading) return <DashboardSkeleton />;
20
+
21
+ const d = {
22
+ totalAlerts: analytics?.totalAlerts ?? 0,
23
+ clearedAlerts: analytics?.clearedAlerts ?? 0,
24
+ escalatedAlerts: analytics?.escalatedAlerts ?? 0,
25
+ avgResolutionTime: analytics?.avgResolutionTime ?? 0,
26
+ screeningVolume: analytics?.screeningVolume ?? [],
27
+ dispositionBreakdown: analytics?.dispositionBreakdown ?? [],
28
+ riskDistribution: analytics?.riskDistribution ?? [],
29
+ topEntities: analytics?.topEntities ?? [],
30
+ };
31
+
32
+ return (
33
+ <div className="space-y-xxl">
34
+ <DashboardGreeting />
35
+ <QuickActions />
36
+
37
+ <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-lg">
38
+ <StatCard title={t('total_alerts')} value={d.totalAlerts} trend={12} color="blue" />
39
+ <StatCard title={t('cleared_today')} value={d.clearedAlerts} trend={8} color="green" />
40
+ <StatCard title={t('escalated')} value={d.escalatedAlerts} trend={-3} color="red" />
41
+ <StatCard title={t('avg_resolution')} value={`${d.avgResolutionTime}h`} description={t('time_in_hours')} color="orange" />
42
+ </div>
43
+
44
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-lg">
45
+ <div className="lg:col-span-2 space-y-lg">
46
+ <div className="glass-panel rounded-apple-lg p-md glow-blue">
47
+ <AreaChartComponent title={t('screening_volume')} data={d.screeningVolume} />
48
+ </div>
49
+ <div className="glass-panel rounded-apple-lg p-md">
50
+ <DonutChart title={t('disposition_breakdown')} data={d.dispositionBreakdown} />
51
+ </div>
52
+ </div>
53
+ <ActivityFeed />
54
+ </div>
55
+
56
+ <ComplianceMetrics />
57
+
58
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-lg">
59
+ <div className="glass-panel rounded-apple-lg p-md">
60
+ <BarChartComponent title={t('risk_distribution')} data={d.riskDistribution} />
61
+ </div>
62
+ <TopEntitiesTable entities={d.topEntities} />
63
+ </div>
64
+ </div>
65
+ );
66
+ }
@@ -0,0 +1,29 @@
1
+ import { render, screen, waitFor } from '@testing-library/react'
2
+ import { describe, it, expect, vi, beforeEach } from 'vitest'
3
+ import { MemoryRouter, Route, Routes } from 'react-router-dom'
4
+ import { EDDWorkflow } from './EDDWorkflow'
5
+
6
+ vi.mock('../api/client', () => ({
7
+ api: {
8
+ get: vi.fn(() => Promise.resolve({
9
+ id: 'edd_1', entity_name: 'John Doe', status: 'in_progress',
10
+ risk_level: 'high', notes: '',
11
+ checklist: { identity_verified: true, source_of_funds: false },
12
+ })),
13
+ },
14
+ }))
15
+
16
+ describe('EDDWorkflow', () => {
17
+ it('renders title after load', async () => {
18
+ render(
19
+ <MemoryRouter initialEntries={['/compliance/edd/edd_1']}>
20
+ <Routes>
21
+ <Route path="/compliance/edd/:id" element={<EDDWorkflow />} />
22
+ </Routes>
23
+ </MemoryRouter>
24
+ )
25
+ await waitFor(() => {
26
+ expect(screen.getByRole('heading', { level: 1 })).toBeInTheDocument()
27
+ })
28
+ })
29
+ })