'use client' import { Search, GitMerge } from 'lucide-react' import { LicenseRuleBadge, VerificationMethodBadge, type CanonicalControl, } from './helpers' interface SimilarControl { control_id: string title: string severity: string release_state: string tags: string[] license_rule: number | null verification_method: string | null category: string | null similarity: number } interface V1Match { matched_control_id: string matched_title: string matched_objective: string matched_severity: string matched_category: string matched_source: string | null matched_article: string | null matched_source_citation: Record | null similarity_score: number match_rank: number match_method: string } interface ControlSimilarControlsProps { ctrl: CanonicalControl similarControls: SimilarControl[] loadingSimilar: boolean selectedDuplicates: Set merging: boolean onToggleDuplicate: (id: string) => void onMergeDuplicates: () => void } export function ControlSimilarControls({ ctrl, similarControls, loadingSimilar, selectedDuplicates, merging, onToggleDuplicate, onMergeDuplicates, }: ControlSimilarControlsProps) { return (

Aehnliche Controls

{loadingSimilar && Laden...}
{similarControls.length > 0 ? ( <>
{ctrl.control_id} — {ctrl.title} Behalten (Haupt-Control)
{similarControls.map(sim => (
onToggleDuplicate(sim.control_id)} className="text-red-600" /> {sim.control_id} {sim.title} {(sim.similarity * 100).toFixed(1)}%
))}
{selectedDuplicates.size > 0 && ( )} ) : (

{loadingSimilar ? 'Suche aehnliche Controls...' : 'Keine aehnlichen Controls gefunden.'}

)}
) }