'use client' // ============================================================================= // Source Policy - New/Edit Source Modals // ============================================================================= interface AllowedSource { id: string domain: string name: string description?: string license?: string legal_basis?: string trust_boost: number source_type: string active: boolean metadata?: Record created_at: string updated_at?: string } const LICENSES = [ { value: 'DL-DE-BY-2.0', label: 'Datenlizenz Deutschland' }, { value: 'CC-BY', label: 'Creative Commons BY' }, { value: 'CC-BY-SA', label: 'Creative Commons BY-SA' }, { value: 'CC0', label: 'Public Domain' }, { value: '§5 UrhG', label: 'Amtliche Werke (§5 UrhG)' }, ] // ============================================================================= // NEW SOURCE MODAL // ============================================================================= interface NewSourceFormState { domain: string name: string license: string legal_basis: string trust_boost: number active: boolean } interface NewSourceModalProps { newSource: NewSourceFormState saving: boolean onClose: () => void onCreate: () => void onChange: (update: Partial) => void } export function NewSourceModal({ newSource, saving, onClose, onCreate, onChange }: NewSourceModalProps) { return (

Neue Quelle hinzufuegen

onChange({ domain: e.target.value })} placeholder="z.B. nibis.de" className="w-full px-4 py-2 border border-slate-200 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
onChange({ name: e.target.value })} placeholder="z.B. NiBiS Bildungsserver" className="w-full px-4 py-2 border border-slate-200 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
onChange({ legal_basis: e.target.value })} placeholder="z.B. §5 UrhG (Amtliche Werke)" className="w-full px-4 py-2 border border-slate-200 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
onChange({ trust_boost: parseFloat(e.target.value) })} className="w-full" />
{(newSource.trust_boost * 100).toFixed(0)}%
) } // ============================================================================= // EDIT SOURCE MODAL // ============================================================================= interface EditSourceModalProps { source: AllowedSource saving: boolean onClose: () => void onSave: () => void onChange: (update: Partial) => void } export function EditSourceModal({ source, saving, onClose, onSave, onChange }: EditSourceModalProps) { return (

Quelle bearbeiten

onChange({ name: e.target.value })} className="w-full px-4 py-2 border border-slate-200 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
onChange({ legal_basis: e.target.value })} className="w-full px-4 py-2 border border-slate-200 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
onChange({ trust_boost: parseFloat(e.target.value) })} className="w-full" />
{(source.trust_boost * 100).toFixed(0)}%
onChange({ active: e.target.checked })} className="w-4 h-4 text-purple-600" />
) }