'use client' import { useState } from 'react' import { GlassCard } from './GlassCard' import type { AbiturDokument } from './DokumentCard' interface CreateKlausurFromTemplateModalProps { template: AbiturDokument onClose: () => void onCreate: (title: string) => void onFallback: () => void isLoading: boolean error: string | null isDark: boolean } export function CreateKlausurFromTemplateModal({ template, onClose, onCreate, onFallback, isLoading, error, isDark, }: CreateKlausurFromTemplateModalProps) { const [title, setTitle] = useState( `${template.fach} ${template.aufgabentyp || ''} ${template.jahr}`.trim() ) const handleSubmit = (e: React.FormEvent) => { e.preventDefault() onCreate(title) } return (

Klausur aus Vorlage erstellen

Basierend auf: {template.thema || template.dateiname}

{error && (

{error}

)}
setTitle(e.target.value)} placeholder="z.B. Deutsch LK Q4 - Kafka" className={`w-full p-3 rounded-xl border focus:ring-2 focus:ring-purple-500 focus:border-transparent ${ isDark ? 'bg-white/10 border-white/20 text-white placeholder-white/40' : 'bg-slate-100 border-slate-300 text-slate-900 placeholder-slate-400' }`} required autoFocus />
{/* Template Info */}
{[ { label: 'Fach', value: template.fach }, { label: 'Jahr', value: String(template.jahr) }, { label: 'Niveau', value: template.niveau }, { label: 'Typ', value: template.aufgabentyp || '-' }, ].map(({ label, value }) => (
{label}: {value}
))}
) }