'use client' import React, { useState, useEffect } from 'react' import { useSDK, Control as SDKControl, ControlType, ImplementationStatus, RiskSeverity } from '@/lib/sdk' import { StepHeader, STEP_EXPLANATIONS } from '@/components/sdk/StepHeader' // ============================================================================= // TYPES // ============================================================================= type DisplayControlType = 'preventive' | 'detective' | 'corrective' type DisplayCategory = 'technical' | 'organizational' | 'physical' type DisplayStatus = 'implemented' | 'partial' | 'planned' | 'not-implemented' // DisplayControl uses SDK Control properties but adds UI-specific fields interface DisplayControl { // From SDKControl id: string name: string description: string type: ControlType category: string implementationStatus: ImplementationStatus evidence: string[] owner: string | null dueDate: Date | null // UI-specific fields code: string displayType: DisplayControlType displayCategory: DisplayCategory displayStatus: DisplayStatus effectivenessPercent: number linkedRequirements: string[] lastReview: Date } // ============================================================================= // HELPER FUNCTIONS // ============================================================================= function mapControlTypeToDisplay(type: ControlType): DisplayCategory { switch (type) { case 'TECHNICAL': return 'technical' case 'ORGANIZATIONAL': return 'organizational' case 'PHYSICAL': return 'physical' default: return 'technical' } } function mapStatusToDisplay(status: ImplementationStatus): DisplayStatus { switch (status) { case 'IMPLEMENTED': return 'implemented' case 'PARTIAL': return 'partial' case 'NOT_IMPLEMENTED': return 'not-implemented' default: return 'not-implemented' } } // ============================================================================= // CONTROL TEMPLATES // ============================================================================= interface ControlTemplate { id: string code: string name: string description: string type: ControlType displayType: DisplayControlType displayCategory: DisplayCategory category: string owner: string linkedRequirements: string[] } const controlTemplates: ControlTemplate[] = [ { id: 'ctrl-tom-001', code: 'TOM-001', name: 'Zugriffskontrolle', description: 'Rollenbasierte Zugriffskontrolle (RBAC) fuer alle Systeme', type: 'TECHNICAL', displayType: 'preventive', displayCategory: 'technical', category: 'Zutrittskontrolle', owner: 'IT Security', linkedRequirements: ['req-gdpr-32'], }, { id: 'ctrl-tom-002', code: 'TOM-002', name: 'Verschluesselung', description: 'Verschluesselung von Daten at rest und in transit', type: 'TECHNICAL', displayType: 'preventive', displayCategory: 'technical', category: 'Weitergabekontrolle', owner: 'IT Security', linkedRequirements: ['req-gdpr-32'], }, { id: 'ctrl-org-001', code: 'ORG-001', name: 'Datenschutzschulung', description: 'Jaehrliche Datenschutzschulung fuer alle Mitarbeiter', type: 'ORGANIZATIONAL', displayType: 'preventive', displayCategory: 'organizational', category: 'Schulung', owner: 'HR', linkedRequirements: ['req-gdpr-6', 'req-gdpr-32'], }, { id: 'ctrl-det-001', code: 'DET-001', name: 'Logging und Monitoring', description: 'Umfassendes Logging aller Datenzugriffe', type: 'TECHNICAL', displayType: 'detective', displayCategory: 'technical', category: 'Eingabekontrolle', owner: 'IT Operations', linkedRequirements: ['req-gdpr-32', 'req-nis2-21'], }, { id: 'ctrl-cor-001', code: 'COR-001', name: 'Incident Response', description: 'Prozess zur Behandlung von Datenschutzvorfaellen', type: 'ORGANIZATIONAL', displayType: 'corrective', displayCategory: 'organizational', category: 'Incident Management', owner: 'CISO', linkedRequirements: ['req-gdpr-32', 'req-nis2-21'], }, { id: 'ctrl-ai-001', code: 'AI-001', name: 'KI-Risikomonitoring', description: 'Kontinuierliche Ueberwachung von KI-Systemrisiken', type: 'TECHNICAL', displayType: 'detective', displayCategory: 'technical', category: 'KI-Governance', owner: 'AI Team', linkedRequirements: ['req-ai-act-9', 'req-ai-act-13'], }, ] // ============================================================================= // COMPONENTS // ============================================================================= function ControlCard({ control, onStatusChange, onEffectivenessChange, }: { control: DisplayControl onStatusChange: (status: ImplementationStatus) => void onEffectivenessChange: (effectivenessPercent: number) => void }) { const [showEffectivenessSlider, setShowEffectivenessSlider] = useState(false) const typeColors = { preventive: 'bg-blue-100 text-blue-700', detective: 'bg-purple-100 text-purple-700', corrective: 'bg-orange-100 text-orange-700', } const categoryColors = { technical: 'bg-green-100 text-green-700', organizational: 'bg-yellow-100 text-yellow-700', physical: 'bg-gray-100 text-gray-700', } const statusColors = { implemented: 'border-green-200 bg-green-50', partial: 'border-yellow-200 bg-yellow-50', planned: 'border-blue-200 bg-blue-50', 'not-implemented': 'border-red-200 bg-red-50', } const statusLabels = { implemented: 'Implementiert', partial: 'Teilweise', planned: 'Geplant', 'not-implemented': 'Nicht implementiert', } return (
{control.description}
Bitte definieren Sie zuerst Anforderungen, um die zugehoerigen Kontrollen zu laden.
Passen Sie den Filter an oder fuegen Sie neue Kontrollen hinzu.