'use client' import React, { useState, useEffect } from 'react' import { useSDK } from '@/lib/sdk' import { CompanyProfile, BusinessModel, OfferingType, TargetMarket, CompanySize, LegalForm, BUSINESS_MODEL_LABELS, OFFERING_TYPE_LABELS, TARGET_MARKET_LABELS, COMPANY_SIZE_LABELS, SDKCoverageAssessment, } from '@/lib/sdk/types' // ============================================================================= // WIZARD STEPS // ============================================================================= const WIZARD_STEPS = [ { id: 1, name: 'Basisinfos', description: 'Firmenname und Rechtsform' }, { id: 2, name: 'Geschäftsmodell', description: 'B2B, B2C und Angebote' }, { id: 3, name: 'Firmengröße', description: 'Mitarbeiter und Umsatz' }, { id: 4, name: 'Standorte', description: 'Hauptsitz und Zielmärkte' }, { id: 5, name: 'Datenschutz', description: 'Rollen und KI-Nutzung' }, ] // ============================================================================= // LEGAL FORMS // ============================================================================= const LEGAL_FORM_LABELS: Record = { einzelunternehmen: 'Einzelunternehmen', gbr: 'GbR', ohg: 'OHG', kg: 'KG', gmbh: 'GmbH', ug: 'UG (haftungsbeschränkt)', ag: 'AG', gmbh_co_kg: 'GmbH & Co. KG', ev: 'e.V. (Verein)', stiftung: 'Stiftung', other: 'Sonstige', } // ============================================================================= // INDUSTRIES // ============================================================================= const INDUSTRIES = [ 'Technologie / IT', 'E-Commerce / Handel', 'Finanzdienstleistungen', 'Gesundheitswesen', 'Bildung', 'Beratung / Consulting', 'Marketing / Agentur', 'Produktion / Industrie', 'Logistik / Transport', 'Immobilien', 'Sonstige', ] // ============================================================================= // HELPER: ASSESS SDK COVERAGE // ============================================================================= function assessSDKCoverage(profile: Partial): SDKCoverageAssessment { const coveredRegulations: string[] = ['DSGVO', 'BDSG', 'TTDSG', 'AI Act'] const partiallyCoveredRegulations: string[] = [] const notCoveredRegulations: string[] = [] const reasons: string[] = [] const recommendations: string[] = [] // Check target markets const targetMarkets = profile.targetMarkets || [] if (targetMarkets.includes('worldwide')) { notCoveredRegulations.push('CCPA (Kalifornien)', 'LGPD (Brasilien)', 'POPIA (Südafrika)') reasons.push('Weltweiter Betrieb erfordert Kenntnisse lokaler Datenschutzgesetze') recommendations.push('Für außereuropäische Märkte empfehlen wir die Konsultation lokaler Rechtsanwälte') } if (targetMarkets.includes('eu_uk')) { partiallyCoveredRegulations.push('UK GDPR', 'UK AI Framework') reasons.push('UK-Recht weicht nach Brexit teilweise von EU-Recht ab') recommendations.push('Prüfen Sie UK-spezifische Anpassungen Ihrer Datenschutzerklärung') } // Check company size if (profile.companySize === 'enterprise' || profile.companySize === 'large') { coveredRegulations.push('NIS2') reasons.push('Als größeres Unternehmen können NIS2-Pflichten relevant sein') } // Check offerings const offerings = profile.offerings || [] if (offerings.includes('webshop')) { coveredRegulations.push('Fernabsatzrecht') recommendations.push('Widerrufsbelehrung und AGB-Generator sind im SDK enthalten') } // Determine if fully covered const requiresLegalCounsel = notCoveredRegulations.length > 0 || targetMarkets.includes('worldwide') const isFullyCovered = !requiresLegalCounsel && notCoveredRegulations.length === 0 return { isFullyCovered, coveredRegulations, partiallyCoveredRegulations, notCoveredRegulations, requiresLegalCounsel, reasons, recommendations, } } // ============================================================================= // STEP COMPONENTS // ============================================================================= function StepBasicInfo({ data, onChange, }: { data: Partial onChange: (updates: Partial) => void }) { return (
onChange({ companyName: e.target.value })} placeholder="Ihre Firma GmbH" className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
onChange({ foundedYear: parseInt(e.target.value) || null })} placeholder="2020" min="1800" max={new Date().getFullYear()} className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
) } function StepBusinessModel({ data, onChange, }: { data: Partial onChange: (updates: Partial) => void }) { const toggleOffering = (offering: OfferingType) => { const current = data.offerings || [] if (current.includes(offering)) { onChange({ offerings: current.filter(o => o !== offering) }) } else { onChange({ offerings: [...current, offering] }) } } return (
{Object.entries(BUSINESS_MODEL_LABELS).map(([value, label]) => ( ))}
{Object.entries(OFFERING_TYPE_LABELS).map(([value, { label, description }]) => ( ))}
) } function StepCompanySize({ data, onChange, }: { data: Partial onChange: (updates: Partial) => void }) { return (
{Object.entries(COMPANY_SIZE_LABELS).map(([value, label]) => ( ))}
) } function StepLocations({ data, onChange, }: { data: Partial onChange: (updates: Partial) => void }) { const toggleMarket = (market: TargetMarket) => { const current = data.targetMarkets || [] if (current.includes(market)) { onChange({ targetMarkets: current.filter(m => m !== market) }) } else { onChange({ targetMarkets: [...current, market] }) } } return (
onChange({ headquartersCity: e.target.value })} placeholder="z.B. Berlin" className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
{Object.entries(TARGET_MARKET_LABELS).map(([value, { label, description, regulations }]) => ( ))}
) } function StepDataProtection({ data, onChange, }: { data: Partial onChange: (updates: Partial) => void }) { return (
onChange({ dpoName: e.target.value || null })} placeholder="Optional" className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
onChange({ dpoEmail: e.target.value || null })} placeholder="dsb@firma.de" className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
) } // ============================================================================= // COVERAGE ASSESSMENT COMPONENT // ============================================================================= function CoverageAssessmentPanel({ profile }: { profile: Partial }) { const assessment = assessSDKCoverage(profile) return (

SDK-Abdeckung

{/* Status */}
{assessment.isFullyCovered ? ( <> Vollständig durch SDK abgedeckt ) : ( <> Teilweise Einschränkungen )}
{/* Covered Regulations */} {assessment.coveredRegulations.length > 0 && (
Abgedeckte Regulierungen
{assessment.coveredRegulations.map(reg => ( {reg} ))}
)} {/* Not Covered */} {assessment.notCoveredRegulations.length > 0 && (
Nicht abgedeckt
{assessment.notCoveredRegulations.map(reg => ( {reg} ))}
)} {/* Recommendations */} {assessment.recommendations.length > 0 && (
Empfehlungen
    {assessment.recommendations.map((rec, i) => (
  • {rec}
  • ))}
)} {/* Legal Counsel Warning */} {assessment.requiresLegalCounsel && (
Rechtsberatung empfohlen
Basierend auf Ihrem Profil empfehlen wir die Konsultation eines spezialisierten Rechtsanwalts für Bereiche, die über den Scope dieses SDKs hinausgehen.
)}
) } // ============================================================================= // MAIN COMPONENT // ============================================================================= export default function CompanyProfilePage() { const { state, dispatch, setCompanyProfile, goToNextStep } = useSDK() const [currentStep, setCurrentStep] = useState(1) const [formData, setFormData] = useState>({ companyName: '', legalForm: undefined, industry: '', foundedYear: null, businessModel: undefined, offerings: [], companySize: undefined, employeeCount: '', annualRevenue: '', headquartersCountry: 'DE', headquartersCity: '', hasInternationalLocations: false, internationalCountries: [], targetMarkets: [], primaryJurisdiction: 'DE', isDataController: true, isDataProcessor: false, usesAI: false, aiUseCases: [], dpoName: null, dpoEmail: null, legalContactName: null, legalContactEmail: null, isComplete: false, completedAt: null, }) // Load existing profile useEffect(() => { if (state.companyProfile) { setFormData(state.companyProfile) // If profile is complete, show last step if (state.companyProfile.isComplete) { setCurrentStep(5) } } }, [state.companyProfile]) const updateFormData = (updates: Partial) => { setFormData(prev => ({ ...prev, ...updates })) } const handleNext = () => { if (currentStep < 5) { setCurrentStep(prev => prev + 1) } else { // Complete profile const completeProfile: CompanyProfile = { ...formData, isComplete: true, completedAt: new Date(), } as CompanyProfile setCompanyProfile(completeProfile) dispatch({ type: 'COMPLETE_STEP', payload: 'company-profile' }) goToNextStep() } } const handleBack = () => { if (currentStep > 1) { setCurrentStep(prev => prev - 1) } } const canProceed = () => { switch (currentStep) { case 1: return formData.companyName && formData.legalForm case 2: return formData.businessModel && (formData.offerings?.length || 0) > 0 case 3: return formData.companySize case 4: return formData.headquartersCountry && (formData.targetMarkets?.length || 0) > 0 case 5: return true default: return false } } return (
{/* Header */}

Unternehmensprofil

Helfen Sie uns, Ihr Unternehmen zu verstehen, damit wir die relevanten Regulierungen identifizieren können.

{/* Progress Steps */}
{WIZARD_STEPS.map((step, index) => (
{step.id < currentStep ? ( ) : ( step.id )}
{step.name}
{index < WIZARD_STEPS.length - 1 && (
)} ))}
{/* Content */}
{/* Form */}

{WIZARD_STEPS[currentStep - 1].name}

{WIZARD_STEPS[currentStep - 1].description}

{currentStep === 1 && } {currentStep === 2 && } {currentStep === 3 && } {currentStep === 4 && } {currentStep === 5 && } {/* Navigation */}
{/* Sidebar: Coverage Assessment */}
{/* Info Box */}
Warum diese Fragen?
Diese Informationen helfen uns, die für Ihr Unternehmen relevanten Regulierungen zu identifizieren und ehrlich zu kommunizieren, wo unsere Grenzen liegen.
) }