'use client' import type { RAGControlSuggestion } from '../_types' export function RAGPanel({ selectedRequirementId, onSelectedRequirementIdChange, requirements, onSuggestControls, ragLoading, ragSuggestions, onAddSuggestion, onClose, }: { selectedRequirementId: string onSelectedRequirementIdChange: (id: string) => void requirements: { id: string; title?: string }[] onSuggestControls: () => void ragLoading: boolean ragSuggestions: RAGControlSuggestion[] onAddSuggestion: (s: RAGControlSuggestion) => void onClose: () => void }) { return (

KI-Controls aus RAG vorschlagen

Geben Sie eine Anforderungs-ID ein. Das KI-System analysiert die Anforderung mit Hilfe des RAG-Corpus und schlaegt passende Controls vor.

onSelectedRequirementIdChange(e.target.value)} placeholder="Anforderungs-UUID eingeben..." className="flex-1 px-4 py-2 border border-purple-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent bg-white" /> {requirements.length > 0 && ( )}
{ragSuggestions.length > 0 && (

{ragSuggestions.length} Vorschlaege gefunden:

{ragSuggestions.map((suggestion) => (
{suggestion.control_id} {suggestion.domain} Konfidenz: {Math.round(suggestion.confidence_score * 100)}%
{suggestion.title}

{suggestion.description}

{suggestion.pass_criteria && (

Erfolgskriterium: {suggestion.pass_criteria}

)} {suggestion.is_automated && ( Automatisierbar {suggestion.automation_tool ? `(${suggestion.automation_tool})` : ''} )}
))}
)} {!ragLoading && ragSuggestions.length === 0 && selectedRequirementId && (

Klicken Sie auf "Vorschlaege generieren", um KI-Controls abzurufen.

)}
) }