'use client' import React, { useState, useCallback } from 'react' import { useRouter } from 'next/navigation' import { useSDK } from '@/lib/sdk' import { StepHeader, STEP_EXPLANATIONS } from '@/components/sdk/StepHeader' import { DocumentUploadSection, type UploadedDocument } from '@/components/sdk' // ============================================================================= // TYPES // ============================================================================= interface TOM { id: string title: string description: string category: 'confidentiality' | 'integrity' | 'availability' | 'resilience' type: 'technical' | 'organizational' status: 'implemented' | 'partial' | 'planned' | 'not-implemented' article32Reference: string lastReview: Date nextReview: Date responsible: string documentation: string | null } // ============================================================================= // MOCK DATA // ============================================================================= const mockTOMs: TOM[] = [ { id: 'tom-1', title: 'Zutrittskontrolle', description: 'Physische Zugangskontrolle zu Serverraeumen und Rechenzentren', category: 'confidentiality', type: 'technical', status: 'implemented', article32Reference: 'Art. 32 Abs. 1 lit. b', lastReview: new Date('2024-01-01'), nextReview: new Date('2024-07-01'), responsible: 'Facility Management', documentation: 'TOM-001-Zutrittskontrolle.pdf', }, { id: 'tom-2', title: 'Zugangskontrolle', description: 'Authentifizierung und Autorisierung fuer IT-Systeme', category: 'confidentiality', type: 'technical', status: 'implemented', article32Reference: 'Art. 32 Abs. 1 lit. b', lastReview: new Date('2024-01-15'), nextReview: new Date('2024-07-15'), responsible: 'IT Security', documentation: 'TOM-002-Zugangskontrolle.pdf', }, { id: 'tom-3', title: 'Verschluesselung', description: 'Verschluesselung von Daten bei Speicherung und Uebertragung', category: 'confidentiality', type: 'technical', status: 'implemented', article32Reference: 'Art. 32 Abs. 1 lit. a', lastReview: new Date('2024-01-10'), nextReview: new Date('2024-07-10'), responsible: 'IT Security', documentation: 'TOM-003-Verschluesselung.pdf', }, { id: 'tom-4', title: 'Datensicherung', description: 'Regelmaessige Backups und Wiederherstellungstests', category: 'availability', type: 'technical', status: 'implemented', article32Reference: 'Art. 32 Abs. 1 lit. c', lastReview: new Date('2023-12-01'), nextReview: new Date('2024-06-01'), responsible: 'IT Operations', documentation: 'TOM-004-Backup.pdf', }, { id: 'tom-5', title: 'Datenschutzschulung', description: 'Regelmaessige Schulungen fuer alle Mitarbeiter', category: 'confidentiality', type: 'organizational', status: 'partial', article32Reference: 'Art. 32 Abs. 1 lit. b', lastReview: new Date('2023-11-01'), nextReview: new Date('2024-02-01'), responsible: 'HR / Datenschutz', documentation: null, }, { id: 'tom-6', title: 'Incident Response Plan', description: 'Prozess zur Behandlung von Sicherheitsvorfaellen', category: 'resilience', type: 'organizational', status: 'planned', article32Reference: 'Art. 32 Abs. 1 lit. c', lastReview: new Date('2024-01-20'), nextReview: new Date('2024-04-20'), responsible: 'CISO', documentation: null, }, { id: 'tom-7', title: 'Protokollierung', description: 'Logging aller sicherheitsrelevanten Ereignisse', category: 'integrity', type: 'technical', status: 'implemented', article32Reference: 'Art. 32 Abs. 1 lit. b', lastReview: new Date('2024-01-05'), nextReview: new Date('2024-07-05'), responsible: 'IT Security', documentation: 'TOM-007-Logging.pdf', }, ] // ============================================================================= // COMPONENTS // ============================================================================= function TOMCard({ tom }: { tom: TOM }) { const categoryColors = { confidentiality: 'bg-blue-100 text-blue-700', integrity: 'bg-green-100 text-green-700', availability: 'bg-purple-100 text-purple-700', resilience: 'bg-orange-100 text-orange-700', } const categoryLabels = { confidentiality: 'Vertraulichkeit', integrity: 'Integritaet', availability: 'Verfuegbarkeit', resilience: 'Belastbarkeit', } const statusColors = { implemented: 'bg-green-100 text-green-700 border-green-200', partial: 'bg-yellow-100 text-yellow-700 border-yellow-200', planned: 'bg-blue-100 text-blue-700 border-blue-200', 'not-implemented': 'bg-red-100 text-red-700 border-red-200', } const statusLabels = { implemented: 'Implementiert', partial: 'Teilweise', planned: 'Geplant', 'not-implemented': 'Nicht implementiert', } const isReviewDue = tom.nextReview <= new Date() return (
{categoryLabels[tom.category]} {tom.type === 'technical' ? 'Technisch' : 'Organisatorisch'} {statusLabels[tom.status]}

{tom.title}

{tom.description}

Rechtsgrundlage: {tom.article32Reference}

Verantwortlich: {tom.responsible}
Naechste Pruefung: {tom.nextReview.toLocaleDateString('de-DE')} {isReviewDue && ' (faellig)'}
{tom.documentation ? ( Dokumentiert ) : ( Keine Dokumentation )}
) } // ============================================================================= // MAIN PAGE // ============================================================================= export default function TOMPage() { const router = useRouter() const { state } = useSDK() const [toms] = useState(mockTOMs) const [filter, setFilter] = useState('all') // Handle uploaded document - import into SDK state const handleDocumentProcessed = useCallback((doc: UploadedDocument) => { console.log('[TOM Page] Document processed:', doc) // In production: Parse document content and add to state.toms }, []) // Open document in workflow editor const handleOpenInEditor = useCallback((doc: UploadedDocument) => { router.push(`/compliance/workflow?documentType=tom&documentId=${doc.id}&mode=change`) }, [router]) const filteredTOMs = filter === 'all' ? toms : toms.filter(t => t.category === filter || t.type === filter || t.status === filter) const implementedCount = toms.filter(t => t.status === 'implemented').length const technicalCount = toms.filter(t => t.type === 'technical').length const organizationalCount = toms.filter(t => t.type === 'organizational').length const reviewDueCount = toms.filter(t => t.nextReview <= new Date()).length const stepInfo = STEP_EXPLANATIONS['tom'] return (
{/* Step Header */} {/* Document Upload Section */} {/* Stats */}
Gesamt
{toms.length}
Implementiert
{implementedCount}
Technisch / Organisatorisch
{technicalCount} / {organizationalCount}
Pruefung faellig
{reviewDueCount}
{/* Article 32 Overview */}

Art. 32 DSGVO - Schutzziele

{toms.filter(t => t.category === 'confidentiality').length}
Vertraulichkeit
{toms.filter(t => t.category === 'integrity').length}
Integritaet
{toms.filter(t => t.category === 'availability').length}
Verfuegbarkeit
{toms.filter(t => t.category === 'resilience').length}
Belastbarkeit
{/* Filter */}
Filter: {['all', 'confidentiality', 'integrity', 'availability', 'resilience', 'technical', 'organizational', 'implemented', 'partial'].map(f => ( ))}
{/* TOM List */}
{filteredTOMs.map(tom => ( ))}
{filteredTOMs.length === 0 && (

Keine TOMs gefunden

Passen Sie den Filter an oder fuegen Sie neue TOMs hinzu.

)}
) }