'use client' import React from 'react' import { REGULATIONS_IN_RAG } from '../rag-constants' import { REGULATIONS, COLLECTION_TOTALS, TYPE_LABELS, TYPE_COLORS, isInRag, getKnownChunks, } from '../rag-data' import type { UseRAGPageReturn } from '../_hooks/useRAGPage' interface OverviewTabProps { hook: UseRAGPageReturn } export function OverviewTab({ hook }: OverviewTabProps) { const { dsfaLoading, dsfaStatus, dsfaSources, setRegulationCategory, setActiveTab, } = hook return (
{/* RAG Categories Overview */}

RAG-Kategorien

NiBiS EH

7.996

Chunks · Bildungs-Erwartungshorizonte

Legal Templates

7.689

Chunks · Dokumentvorlagen (VVT, TOM, DSFA)

{/* Quick Stats per Type */}
{Object.entries(TYPE_LABELS).map(([type, label]) => { const regs = REGULATIONS.filter((r) => r.type === type) const inRagCount = regs.filter((r) => isInRag(r.code)).length const totalChunks = regs.reduce((sum, r) => sum + getKnownChunks(r.code), 0) return (
{label} {inRagCount}/{regs.length} im RAG

{totalChunks.toLocaleString()} Chunks

) })}
{/* Top Regulations */}

Top Regulierungen (nach Chunks)

{[...REGULATIONS].sort((a, b) => getKnownChunks(b.code) - getKnownChunks(a.code)) .slice(0, 10) .map((reg) => { const chunks = getKnownChunks(reg.code) return (
{isInRag(reg.code) ? ( ) : ( )} {TYPE_LABELS[reg.type]} {reg.name} ({reg.code})
0 ? 'text-teal-600' : 'text-slate-300'}`}>{chunks > 0 ? chunks.toLocaleString() + ' Chunks' : '—'}
) })}
) }