'use client' // ============================================================================= // Step 6: Review & Export // Summary, derived TOMs table, gap analysis, and export // ============================================================================= import { useEffect, useState } from 'react' import { useTOMGenerator } from '@/lib/sdk/tom-generator' import { SummaryCard, TOMsTable, GapAnalysisPanel, ExportPanel } from './ReviewExportPanels' export function ReviewExportStep() { const { state, deriveTOMs, completeCurrentStep } = useTOMGenerator() const [activeTab, setActiveTab] = useState<'summary' | 'toms' | 'gaps' | 'export'>('summary') // Derive TOMs if not already done useEffect(() => { if (state.derivedTOMs.length === 0 && state.companyProfile && state.dataProfile) { deriveTOMs() } }, [state, deriveTOMs]) // Mark step as complete when viewing useEffect(() => { completeCurrentStep({ reviewed: true }) }, [completeCurrentStep]) // Statistics const stats = { totalTOMs: state.derivedTOMs.length, required: state.derivedTOMs.filter((t) => t.applicability === 'REQUIRED').length, implemented: state.derivedTOMs.filter((t) => t.implementationStatus === 'IMPLEMENTED').length, partial: state.derivedTOMs.filter((t) => t.implementationStatus === 'PARTIAL').length, documents: state.documents.length, score: state.gapAnalysis?.overallScore ?? 0, } const tabs = [ { id: 'summary', label: 'Zusammenfassung' }, { id: 'toms', label: 'TOMs-Tabelle' }, { id: 'gaps', label: 'Lückenanalyse' }, { id: 'export', label: 'Export' }, ] return (
{/* Tabs */}
{/* Tab Content */}
{activeTab === 'summary' && (
{/* Stats Grid */}
= 80 ? 'success' : stats.score >= 50 ? 'warning' : 'danger'} />
{/* Profile Summaries */}
{/* Company */} {state.companyProfile && (

Unternehmen

Name:
{state.companyProfile.name}
Branche:
{state.companyProfile.industry}
Rolle:
{state.companyProfile.role}
)} {/* Risk */} {state.riskProfile && (

Schutzbedarf

Level:
{state.riskProfile.protectionLevel}
DSFA erforderlich:
{state.riskProfile.dsfaRequired ? 'Ja' : 'Nein'}
CIA (V/I/V):
{state.riskProfile.ciaAssessment.confidentiality}/ {state.riskProfile.ciaAssessment.integrity}/ {state.riskProfile.ciaAssessment.availability}
)}
)} {activeTab === 'toms' && } {activeTab === 'gaps' && } {activeTab === 'export' && }
) } export default ReviewExportStep