'use client' import React from 'react' import { REGULATIONS, TYPE_COLORS, TYPE_LABELS, isInRag, getKnownChunks, } from '../rag-data' import { REGULATION_SOURCES, REGULATION_LICENSES, LICENSE_LABELS, } from '../rag-sources' import type { UseRAGPageReturn } from '../_hooks/useRAGPage' interface RegulationsTabProps { hook: UseRAGPageReturn } export function RegulationsTab({ hook }: RegulationsTabProps) { const { regulationCategory, setRegulationCategory, expandedRegulation, setExpandedRegulation, fetchStatus, dsfaSources, dsfaLoading, expandedDsfaSource, setExpandedDsfaSource, fetchDsfaStatus, setActiveTab, } = hook return (
{/* Category Filter */}
{/* Regulations Table */} {regulationCategory === 'regulations' && ( )} {/* DSFA Sources */} {regulationCategory === 'dsfa' && ( )} {/* NiBiS Dokumente (info only) */} {regulationCategory === 'nibis' && } {/* Templates (info only) */} {regulationCategory === 'templates' && }
) } // --- Sub-components --- function RegulationsTable({ expandedRegulation, setExpandedRegulation, fetchStatus, setActiveTab, }: { expandedRegulation: string | null setExpandedRegulation: (v: string | null) => void fetchStatus: () => void setActiveTab: (v: any) => void }) { return (

Alle {REGULATIONS.length} Regulierungen ({REGULATIONS.filter(r => isInRag(r.code)).length} im RAG,{' '} {REGULATIONS.filter(r => !isInRag(r.code)).length} ausstehend)

{REGULATIONS.map((reg) => { const chunks = getKnownChunks(reg.code) const inRag = isInRag(reg.code) const statusColor = inRag ? 'text-green-500' : 'text-red-500' const statusIcon = inRag ? '✓' : '❌' const isExpanded = expandedRegulation === reg.code return ( setExpandedRegulation(isExpanded ? null : reg.code)} className="hover:bg-slate-50 cursor-pointer transition-colors" > {isExpanded && ( )} ) })}
RAG Code Typ Name Chunks Erwartet Status
{isInRag(reg.code) ? ( ) : ( )} {reg.code} {TYPE_LABELS[reg.type]} {reg.name} 0 && chunks < 10 && reg.expected >= 10 ? 'text-amber-600' : ''}> {chunks.toLocaleString()} {chunks > 0 && chunks < 10 && reg.expected >= 10 && ( )} {reg.expected} {statusIcon}

{reg.fullName}

{reg.description}

Relevant fuer

{reg.relevantFor.map((item, idx) => ( {item} ))}

Kernthemen

{reg.keyTopics.map((topic, idx) => ( {topic} ))}
In Kraft seit: {reg.effectiveDate} {REGULATION_LICENSES[reg.code] && ( {LICENSE_LABELS[REGULATION_LICENSES[reg.code].license] || REGULATION_LICENSES[reg.code].license} {REGULATION_LICENSES[reg.code].licenseNote} )}
{REGULATION_SOURCES[reg.code] && ( e.stopPropagation()} className="text-blue-600 hover:text-blue-700 font-medium" > Originalquelle → )}
) } function DsfaSourcesList({ dsfaSources, dsfaLoading, expandedDsfaSource, setExpandedDsfaSource, fetchDsfaStatus, }: { dsfaSources: any[] dsfaLoading: boolean expandedDsfaSource: string | null setExpandedDsfaSource: (v: string | null) => void fetchDsfaStatus: () => void }) { const typeColors: Record = { regulation: 'bg-blue-100 text-blue-700', legislation: 'bg-indigo-100 text-indigo-700', guideline: 'bg-teal-100 text-teal-700', checklist: 'bg-yellow-100 text-yellow-700', standard: 'bg-green-100 text-green-700', methodology: 'bg-purple-100 text-purple-700', specification: 'bg-orange-100 text-orange-700', catalog: 'bg-pink-100 text-pink-700', guidance: 'bg-cyan-100 text-cyan-700', } return (

DSFA Quellen ({dsfaSources.length || '~70'})

WP248, DSK Kurzpapiere, Muss-Listen, nationale Datenschutzgesetze

{dsfaLoading ? (
Lade DSFA-Quellen...
) : dsfaSources.length === 0 ? (

Keine DSFA-Quellen vom Backend geladen.

Endpunkt: /api/dsfa-corpus?action=sources

) : (
{dsfaSources.map((source) => { const isExpanded = expandedDsfaSource === source.source_code return (
setExpandedDsfaSource(isExpanded ? null : source.source_code)} className="px-4 py-3 hover:bg-slate-50 cursor-pointer transition-colors flex items-center justify-between" >
{source.source_code} {source.document_type} {source.name}
{source.language} {source.chunk_count != null && ( {source.chunk_count} Chunks )}
{isExpanded && (

{source.full_name || source.name}

{source.organization && (

Organisation: {source.organization}

)}
{LICENSE_LABELS[source.license_code] || source.license_code} {source.attribution_text}
{source.source_url && ( )}
)}
) })}
)}
) } function NibisInfo() { return (
📚

NiBiS Erwartungshorizonte

Collection: bp_nibis_eh

Chunks

7.996

Vector Size

1024

Typ

BGE-M3

Bildungsinhalte aus dem Niedersaechsischen Bildungsserver (NiBiS). Enthaelt Erwartungshorizonte fuer verschiedene Faecher und Schulformen. Wird ueber die Klausur-Korrektur fuer EH-Matching genutzt. Diese Daten sind nicht direkt compliance-relevant.

) } function TemplatesInfo() { return (
📋

Legal Templates & Vorlagen

Collection: bp_legal_templates

Chunks

7.689

Vector Size

1024

Typ

BGE-M3

Vorlagen fuer VVT (Verzeichnis von Verarbeitungstaetigkeiten), TOM (Technisch-Organisatorische Massnahmen), DSFA-Berichte und weitere Compliance-Dokumente. Werden vom AI Compliance SDK fuer die Dokumentgenerierung genutzt.

) }