feat: Company profile preset selector on onboarding
Shows preset cards before the wizard when the profile is empty: - 10 industry presets (SaaS, Consumer App, E-Commerce, IT-Agentur, Maschinenbau, Rechtsanwalt, Arztpraxis, Handwerk, Bildung, Enterprise) - Each with icon, label, and description - Click prefills: legalForm, industry, businessModel, companySize, employeeCount, country, targetMarkets, dataController/Processor - "Manuell ausfuellen" skip option - Only shown when companyName is empty (fresh start) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import React from 'react'
|
||||
import React, { useState } from 'react'
|
||||
import { useCompanyProfileForm } from './_hooks/useCompanyProfileForm'
|
||||
import { STEP_EXPLANATIONS } from './_components/constants'
|
||||
import { StepBasicInfo } from './_components/StepBasicInfo'
|
||||
@@ -11,6 +11,8 @@ 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 {
|
||||
@@ -21,6 +23,35 @@ export default function CompanyProfilePage() {
|
||||
isDeleting, goToNextStep,
|
||||
} = useCompanyProfileForm()
|
||||
|
||||
const [showPresets, setShowPresets] = useState(!formData.companyName)
|
||||
|
||||
// Preset selection view (before wizard)
|
||||
if (showPresets && currentStep !== 99) {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 py-8">
|
||||
<div className="max-w-6xl mx-auto px-4">
|
||||
<PresetSelector
|
||||
onSelect={(preset) => {
|
||||
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)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// Summary view (step 99)
|
||||
if (currentStep === 99) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user