'use client' import { useState, useEffect } from 'react' import { useLanguage } from '@/lib/LanguageContext' import { useTheme } from '@/lib/ThemeContext' import { GermanyMap, bundeslaender } from './GermanyMap' import { CityMap } from './CityMap' import { SchoolSearch } from './SchoolSearch' import { BPIcon } from './Logo' interface OnboardingWizardProps { onComplete: (data: OnboardingData) => void } export interface OnboardingData { bundesland: string bundeslandName: string city: string cityLat?: number cityLng?: number schoolName: string schoolType: string } // Schulformen mit Icons und Beschreibungen const schulformen = [ // Allgemeinbildende Schulen { id: 'gymnasium', name: 'Gymnasium', icon: '🎓', description: 'Allgemeinbildend bis Abitur', category: 'allgemein' }, { id: 'gesamtschule', name: 'Gesamtschule', icon: '🏫', description: 'Integriert/kooperativ', category: 'allgemein' }, { id: 'realschule', name: 'Realschule', icon: '📚', description: 'Mittlerer Abschluss', category: 'allgemein' }, { id: 'hauptschule', name: 'Hauptschule', icon: '📖', description: 'Erster Abschluss', category: 'allgemein' }, { id: 'mittelschule', name: 'Mittelschule', icon: '📝', description: 'Bayern/Sachsen', category: 'allgemein' }, { id: 'oberschule', name: 'Oberschule', icon: '🏛️', description: 'Sachsen/Brandenburg', category: 'allgemein' }, { id: 'stadtteilschule', name: 'Stadtteilschule', icon: '🌆', description: 'Hamburg', category: 'allgemein' }, { id: 'gemeinschaftsschule', name: 'Gemeinschaftsschule', icon: '🤲', description: 'BW/SH/TH/SL/BE', category: 'allgemein' }, // Berufliche Schulen { id: 'berufsschule', name: 'Berufsschule', icon: '🔧', description: 'Duale Ausbildung', category: 'beruflich' }, { id: 'berufliches_gymnasium', name: 'Berufl. Gymnasium', icon: '💼', description: 'Fachgebundenes Abitur', category: 'beruflich' }, { id: 'fachoberschule', name: 'Fachoberschule', icon: '📊', description: 'Fachhochschulreife', category: 'beruflich' }, { id: 'berufsfachschule', name: 'Berufsfachschule', icon: '🛠️', description: 'Vollzeitberufliche Bildung', category: 'beruflich' }, // Sonder- und Förderschulen { id: 'foerderschule', name: 'Förderschule', icon: '🤝', description: 'Sonderpädagogisch', category: 'foerder' }, { id: 'foerderzentrum', name: 'Förderzentrum', icon: '💚', description: 'Inklusiv/integriert', category: 'foerder' }, // Privatschulen & Besondere Formen { id: 'privatschule', name: 'Privatschule', icon: '🏰', description: 'Freier Träger', category: 'privat' }, { id: 'internat', name: 'Internat', icon: '🛏️', description: 'Mit Unterbringung', category: 'privat' }, { id: 'waldorfschule', name: 'Waldorfschule', icon: '🌿', description: 'Anthroposophisch', category: 'alternativ' }, { id: 'montessori', name: 'Montessori-Schule', icon: '🧒', description: 'Montessori-Pädagogik', category: 'alternativ' }, // Grundschulen { id: 'grundschule', name: 'Grundschule', icon: '🏠', description: 'Klasse 1-4', category: 'grund' }, // Internationale { id: 'internationale_schule', name: 'Internationale Schule', icon: '🌍', description: 'IB/Cambridge', category: 'international' }, { id: 'europaeische_schule', name: 'Europäische Schule', icon: '🇪🇺', description: 'EU-Curriculum', category: 'international' }, ] // Kategorien für die Anzeige const schulformKategorien = [ { id: 'allgemein', name: 'Allgemeinbildend', icon: '📚' }, { id: 'beruflich', name: 'Berufsbildend', icon: '💼' }, { id: 'foerder', name: 'Förderschulen', icon: '💚' }, { id: 'privat', name: 'Privat & Internat', icon: '🏰' }, { id: 'alternativ', name: 'Alternative Pädagogik', icon: '🌿' }, { id: 'grund', name: 'Primarstufe', icon: '🏠' }, { id: 'international', name: 'International', icon: '🌍' }, ] export function OnboardingWizard({ onComplete }: OnboardingWizardProps) { const { t } = useLanguage() const { isDark } = useTheme() const [step, setStep] = useState(1) const [data, setData] = useState>({}) const [citySearch, setCitySearch] = useState('') const [schoolSearch, setSchoolSearch] = useState('') const totalSteps = 4 const handleNext = () => { if (step < totalSteps) { setStep(step + 1) } else { // Abschluss onComplete(data as OnboardingData) } } const handleBack = () => { if (step > 1) { setStep(step - 1) } } const canProceed = () => { switch (step) { case 1: return !!data.bundesland case 2: return !!data.city && data.city.trim().length > 0 case 3: return !!data.schoolName && data.schoolName.trim().length > 0 case 4: return !!data.schoolType default: return false } } return (
{/* Animated Background */}
{/* Logo & Willkommen */}

BreakPilot Studio

Willkommen! Lassen Sie uns loslegen.

{/* Progress Bar */}
{[1, 2, 3, 4].map((s) => (
{s < step ? '✓' : s}
))}
{/* Main Card */}
{/* Step 1: Bundesland */} {step === 1 && (

In welchem Bundesland unterrichten Sie?

Klicken Sie auf Ihr Bundesland in der Karte

setData({ ...data, bundesland: stateId, bundeslandName: bundeslaender[stateId as keyof typeof bundeslaender] })} className="mx-auto max-w-md" />
)} {/* Step 2: Stadt */} {step === 2 && (

In welcher Stadt arbeiten Sie?

Suchen Sie Ihre Stadt oder klicken Sie auf die Karte

{/* Info Box - Bundesland */}
📍 {data.bundeslandName}
{/* CityMap Komponente */} setData({ ...data, city, cityLat: lat, cityLng: lng })} className="max-w-lg mx-auto" />
)} {/* Step 3: Schule */} {step === 3 && (

Wie heißt Ihre Schule?

Suchen Sie Ihre Schule oder geben Sie den Namen ein

{/* SchoolSearch Komponente mit Autocomplete */} setData({ ...data, schoolName })} className="max-w-lg mx-auto" />
)} {/* Step 4: Schulform */} {step === 4 && (

Welche Schulform ist es?

Wählen Sie die passende Schulform

{/* Scrollbarer Bereich mit Kategorien */}
{schulformKategorien.map((kategorie) => { const formenInKategorie = schulformen.filter(f => f.category === kategorie.id) if (formenInKategorie.length === 0) return null return (
{/* Kategorie-Header */}
{kategorie.icon} {kategorie.name}
{/* Schulformen in dieser Kategorie */}
{formenInKategorie.map((form) => { const isSelected = data.schoolType === form.id return ( ) })}
) })}
{/* Summary */} {data.schoolType && (

{data.schoolName}

{schulformen.find(f => f.id === data.schoolType)?.name} in {data.city}, {data.bundeslandName}

)}
)}
{/* Navigation Buttons */}
{step > 1 && ( )}
{/* Skip Option */}
) }