'use client' import { useState } from 'react' import type { TrainingConfig } from './types' const BUNDESLAENDER = [ { code: 'ni', name: 'Niedersachsen', allowed: true }, { code: 'by', name: 'Bayern', allowed: true }, { code: 'nw', name: 'NRW', allowed: true }, { code: 'he', name: 'Hessen', allowed: true }, { code: 'bw', name: 'Baden-Württemberg', allowed: true }, { code: 'rp', name: 'Rheinland-Pfalz', allowed: true }, { code: 'sn', name: 'Sachsen', allowed: true }, { code: 'sh', name: 'Schleswig-Holstein', allowed: true }, { code: 'th', name: 'Thüringen', allowed: true }, { code: 'be', name: 'Berlin', allowed: false }, { code: 'bb', name: 'Brandenburg', allowed: false }, { code: 'hb', name: 'Bremen', allowed: false }, { code: 'hh', name: 'Hamburg', allowed: false }, { code: 'mv', name: 'Mecklenburg-Vorpommern', allowed: false }, { code: 'sl', name: 'Saarland', allowed: false }, { code: 'st', name: 'Sachsen-Anhalt', allowed: false }, ] export function NewTrainingModal({ isOpen, onClose, onSubmit }: { isOpen: boolean onClose: () => void onSubmit: (config: Partial) => void }) { const [step, setStep] = useState(1) const [config, setConfig] = useState>({ batch_size: 16, learning_rate: 0.00005, epochs: 10, warmup_steps: 500, weight_decay: 0.01, gradient_accumulation: 4, mixed_precision: true, bundeslaender: [], }) if (!isOpen) return null return (
{/* Header */}

Neues Training starten

Schritt {step} von 3

{/* Progress Steps */}
{[1, 2, 3].map((s) => (
{s < step ? '✓' : s}
{s < 3 && (
)}
))}
Daten Parameter Bestätigen
{/* Content */}
{step === 1 && ( )} {step === 2 && ( )} {step === 3 && ( )}
{/* Footer */}
) } function BundeslandStep({ config, setConfig }: { config: Partial setConfig: (c: Partial) => void }) { return (

Wählen Sie die Bundesländer für das Training

Nur Bundesländer mit Training-Erlaubnis können ausgewählt werden.

{BUNDESLAENDER.map((bl) => ( ))}
) } function ParameterStep({ config, setConfig }: { config: Partial setConfig: (c: Partial) => void }) { return (

Training-Parameter konfigurieren

setConfig({ ...config, batch_size: parseInt(e.target.value) })} className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700" />
setConfig({ ...config, learning_rate: parseFloat(e.target.value) })} className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700" />
setConfig({ ...config, epochs: parseInt(e.target.value) })} className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700" />
setConfig({ ...config, warmup_steps: parseInt(e.target.value) })} className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700" />
setConfig({ ...config, mixed_precision: e.target.checked })} className="w-4 h-4 text-blue-600 rounded" />
) } function ConfirmStep({ config }: { config: Partial }) { return (

Training-Konfiguration bestätigen

Bundesländer{config.bundeslaender?.length || 0} ausgewählt
Epochen{config.epochs}
Batch Size{config.batch_size}
Learning Rate{config.learning_rate}
Mixed Precision{config.mixed_precision ? 'Aktiviert' : 'Deaktiviert'}

Hinweis: Das Training kann je nach Datenmenge und Konfiguration mehrere Stunden dauern. Sie können den Fortschritt jederzeit überwachen.

) }