import { ComplianceReport } from '../types/analysis'; import { Shield, AlertCircle, CheckCircle2, FileCheck } from 'lucide-react'; import { Progress } from './ui/progress'; import { Card } from './ui/card'; import { Badge } from './ui/badge'; interface CompliancePanelProps { report: ComplianceReport; } export function CompliancePanel({ report }: CompliancePanelProps) { const getComplianceColor = () => { if (report.cfpbAlignment >= 80) return 'text-emerald-400'; if (report.cfpbAlignment >= 60) return 'text-amber-400'; if (report.cfpbAlignment >= 45) return 'text-orange-400'; return 'text-rose-400'; }; const getComplianceBg = () => { if (report.cfpbAlignment >= 80) return 'from-emerald-500/10 via-emerald-500/5 to-transparent border-emerald-500/30'; if (report.cfpbAlignment >= 60) return 'from-amber-500/10 via-amber-500/5 to-transparent border-amber-500/30'; if (report.cfpbAlignment >= 45) return 'from-orange-500/10 via-orange-500/5 to-transparent border-orange-500/30'; return 'from-rose-500/10 via-rose-500/5 to-transparent border-rose-500/30'; }; const getComplianceStatus = () => { if (report.cfpbAlignment >= 80) return 'Compliant'; if (report.cfpbAlignment >= 60) return 'Needs Improvement'; if (report.cfpbAlignment >= 45) return 'Non-Compliant'; return 'Critically Non-Compliant'; }; const getBadgeVariantClass = () => { if (report.cfpbAlignment >= 80) return 'bg-emerald-500/10 text-emerald-400 border border-emerald-500/20'; if (report.cfpbAlignment >= 60) return 'bg-amber-500/10 text-amber-400 border border-amber-500/20'; if (report.cfpbAlignment >= 45) return 'bg-orange-500/10 text-orange-400 border border-orange-500/20'; return 'bg-rose-500/10 text-rose-400 border border-rose-500/20'; }; return (
Status: {getComplianceStatus()}
This score reflects alignment with the Consumer Financial Protection Bureau (CFPB) guidelines against deceptive practices in financial services, calculated by deducting points based on the severity of issues found.
{issue}
{recommendation}
Prohibits unfair, deceptive, or abusive acts or practices (UDAAP) in connection with consumer financial products or services.
Requires clear disclosure of key terms and costs of consumer credit, ensuring transparency in lending practices.
Protects consumers engaging in electronic fund transfers, requiring clear disclosure of terms and conditions.
Prohibits abusive, unfair, or deceptive practices by debt collectors, including manipulative communication tactics.
Our compliance engine uses natural language processing to match detected dark patterns against CFPB regulation text. Each violation is cross-referenced with specific guideline sections to provide actionable, legally-grounded recommendations. The compliance score is calculated using a weighted severity model that prioritizes consumer protection.