'use client' import React, { useState } from 'react' import { useCompanyProfileForm } from './_hooks/useCompanyProfileForm' import { STEP_EXPLANATIONS } from './_components/constants' import { StepBasicInfo } from './_components/StepBasicInfo' import { StepBusinessModel } from './_components/StepBusinessModel' import { StepCompanySize } from './_components/StepCompanySize' import { StepLocations } from './_components/StepLocations' import { StepDataProtection } from './_components/StepDataProtection' import { StepLegalFramework } from './_components/StepLegalFramework' import { StepMachineBuilder } from './_components/StepMachineBuilder' import { ProfileSummary } from './_components/ProfileSummary' import { PresetSelector } from './_components/PresetSelector' import { COMPANY_PROFILE_PRESETS } from '@/lib/sdk/company-profile-presets' export default function CompanyProfilePage() { const { formData, updateFormData, currentStep, setCurrentStep, wizardSteps, showMachineBuilderStep, isLastStep, draftSaveStatus, canProceed, handleNext, handleBack, handleDeleteProfile, showDeleteConfirm, setShowDeleteConfirm, isDeleting, goToNextStep, } = useCompanyProfileForm() const [showPresets, setShowPresets] = useState(!formData.companyName) // Preset selection view (before wizard) if (showPresets && currentStep !== 99) { return (
{ updateFormData({ legalForm: preset.profile.legalForm as never, industry: preset.profile.industry, businessModel: preset.profile.businessModel as never, companySize: preset.profile.companySize as never, employeeCount: preset.profile.employeeCount, headquartersCountry: preset.profile.headquartersCountry, targetMarkets: preset.profile.targetMarkets as never[], isDataController: preset.profile.isDataController, isDataProcessor: preset.profile.isDataProcessor, }) setShowPresets(false) }} onSkip={() => setShowPresets(false)} />
) } // Summary view (step 99) if (currentStep === 99) { return ( setCurrentStep(1)} onContinue={() => goToNextStep()} /> ) } // Wizard view (steps 1-7) return (
{/* Header */}

Unternehmensprofil

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

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

{(wizardSteps.find(s => s.id === currentStep) || wizardSteps[0]).name}

{(wizardSteps.find(s => s.id === currentStep) || wizardSteps[0]).description}

{STEP_EXPLANATIONS[currentStep] && (

{STEP_EXPLANATIONS[currentStep]}

)}
{currentStep === 1 && } {currentStep === 2 && } {currentStep === 3 && } {currentStep === 4 && } {currentStep === 5 && } {currentStep === 6 && } {currentStep === 7 && showMachineBuilderStep && } {/* Navigation */}
{draftSaveStatus !== 'idle' && ( {draftSaveStatus === 'saving' && 'Speichern...'} {draftSaveStatus === 'saved' && '\u2713 Gespeichert'} {draftSaveStatus === 'error' && 'Speichern fehlgeschlagen'} )}
{/* Delete Confirmation Modal */} {showDeleteConfirm && (

Profil löschen?

Alle gespeicherten Unternehmensdaten werden unwiderruflich gelöscht (DSGVO Art. 17). Diese Aktion kann nicht rückgängig gemacht werden.

)}
) }