'use client' import React from 'react' import type { FollowUpQuestion } from '../_hooks/useAgentAnalysis' const SEVERITY_STYLE: Record = { high: { border: 'border-red-300', bg: 'bg-red-50', icon: '!!' }, medium: { border: 'border-yellow-300', bg: 'bg-yellow-50', icon: '!' }, low: { border: 'border-blue-300', bg: 'bg-blue-50', icon: 'i' }, } interface Props { questions: FollowUpQuestion[] answers: Record onAnswer: (questionId: string, answer: boolean) => void } export function FollowUpQuestions({ questions, answers, onAnswer }: Props) { const unanswered = questions.filter(q => answers[q.id] === undefined) const answered = questions.filter(q => answers[q.id] !== undefined) if (questions.length === 0) return null return (

Rueckfragen zur manuellen Pruefung ({unanswered.length} offen)

{/* Unanswered questions */} {unanswered.map(q => { const style = SEVERITY_STYLE[q.severity] || SEVERITY_STYLE.medium return (
{SEVERITY_STYLE[q.severity]?.icon || '?'}

{q.question}

Rechtsgrundlage: {q.legal_basis}

) })} {/* Answered questions */} {answered.map(q => { const isYes = answers[q.id] return (
{isYes ? '✓' : '✗'} {q.question} {isYes ? 'Ja — OK' : 'Nein — Finding erstellt'}
{!isYes && (

{q.finding_if_no}

)}
) })}
) }