'use client'; import { useControls } from '@breakpilot/compliance-sdk-react'; import Link from 'next/link'; import { ArrowLeft, CheckCircle, Shield, FileCheck, AlertTriangle, Target, BarChart3, FileText, Download, } from 'lucide-react'; export default function CompliancePage() { const { controls, evidence, risks, isLoading } = useControls(); const domains = [ { id: 'access', name: 'Access Control', count: 5 }, { id: 'data', name: 'Data Protection', count: 6 }, { id: 'network', name: 'Network Security', count: 4 }, { id: 'incident', name: 'Incident Response', count: 5 }, { id: 'business', name: 'Business Continuity', count: 4 }, { id: 'vendor', name: 'Vendor Management', count: 4 }, { id: 'training', name: 'Security Training', count: 4 }, { id: 'physical', name: 'Physical Security', count: 6 }, { id: 'governance', name: 'Governance', count: 6 }, ]; const controlStats = { total: controls?.length ?? 44, implemented: controls?.filter((c) => c.implementationStatus === 'IMPLEMENTED').length ?? 32, inProgress: controls?.filter((c) => c.implementationStatus === 'IN_PROGRESS').length ?? 8, notImplemented: controls?.filter((c) => c.implementationStatus === 'NOT_IMPLEMENTED') .length ?? 4, }; const implementationRate = Math.round( (controlStats.implemented / controlStats.total) * 100 ); return (
{/* Header */}

Compliance Hub

Controls, Evidence & Obligations

Export Report
{/* Stats Overview */}
{implementationRate}%
Implementation Rate
{controlStats.implemented}
Controls Implemented
of {controlStats.total} total
{evidence?.length ?? 0}
Evidence Items
Uploaded documents
{risks?.filter((r) => r.status !== 'MITIGATED').length ?? 0}
Open Risks
Require attention
{/* Quick Links */}

Controls

44+ controls in 9 domains

Evidence

{evidence?.length ?? 0} documents uploaded

Risk Register

{risks?.length ?? 0} risks tracked

{/* Control Domains */}

Control Domains

{domains.map((domain) => { const domainControls = controls?.filter( (c) => c.domain === domain.id ); const implemented = domainControls?.filter( (c) => c.implementationStatus === 'IMPLEMENTED' ).length ?? 0; const total = domain.count; const percent = Math.round((implemented / total) * 100); return (
{domain.name} {implemented}/{total}
= 50 ? 'bg-blue-500' : 'bg-yellow-500' }`} style={{ width: `${percent}%` }} />
); })}
); }