'use client' import { ExternalLink, Scale } from 'lucide-react' import type { CanonicalControl } from './helpers' export function ControlSourceCitation({ ctrl }: { ctrl: CanonicalControl }) { if (!ctrl.source_citation) return null const stype = ctrl.source_citation.source_type const colorSet = stype === 'law' ? { bg: 'bg-blue-50 border-blue-200', icon: 'text-blue-600', title: 'text-blue-900', badge: 'bg-blue-100 text-blue-700' } : stype === 'guideline' ? { bg: 'bg-indigo-50 border-indigo-200', icon: 'text-indigo-600', title: 'text-indigo-900', badge: 'bg-indigo-100 text-indigo-700' } : { bg: 'bg-teal-50 border-teal-200', icon: 'text-teal-600', title: 'text-teal-900', badge: 'bg-teal-100 text-teal-700' } const sectionTitle = stype === 'law' ? 'Gesetzliche Grundlage' : stype === 'guideline' ? 'Behoerdliche Leitlinie' : 'Standard / Best Practice' const badgeText = stype === 'law' ? 'Direkte gesetzliche Pflicht' : stype === 'guideline' ? 'Aufsichtsbehoerdliche Empfehlung' : stype === 'standard' || (!stype && ctrl.license_rule === 2) ? 'Freiwilliger Standard' : !stype && ctrl.license_rule === 1 ? 'Noch nicht klassifiziert' : null return (

{sectionTitle}

{badgeText && {badgeText}}
{ctrl.source_citation.source ? (

{ctrl.source_citation.source} {ctrl.source_citation.article && ` — ${ctrl.source_citation.article}`} {ctrl.source_citation.paragraph && ` ${ctrl.source_citation.paragraph}`}

) : ctrl.generation_metadata?.source_regulation ? (

{String(ctrl.generation_metadata.source_regulation)}

) : null} {ctrl.source_citation.license &&

Lizenz: {ctrl.source_citation.license}

} {ctrl.source_citation.license_notice &&

{ctrl.source_citation.license_notice}

}
{ctrl.source_citation.url && ( Quelle )}
{ctrl.source_original_text && (
Originaltext anzeigen

{ctrl.source_original_text}

)}
) }