import { Box, Button, Card, Typography } from '@mui/material' import { ArrowRight, RefreshCw } from 'lucide-react' import type { FollowUpQuestion } from '../../domain/needBuilder' import { FollowUpQuestionCard } from './FollowUpQuestionCard' interface Props { questions: FollowUpQuestion[] answers: Record onAnswer: (id: string, answer: string) => void onContinue: () => void onReparse?: () => void } export function FollowUpPanel({ questions, answers, onAnswer, onContinue, onReparse }: Props) { const requiredUnanswered = questions .filter(q => q.importance === 'required') .filter(q => !answers[q.id]) const sorted = [ ...questions.filter(q => q.importance === 'required'), ...questions.filter(q => q.importance === 'recommended'), ...questions.filter(q => q.importance === 'optional'), ] return ( Rückfragen der KI Beantworten Sie die Pflichtfelder für optimale Ergebnisse. Optionale Fragen können übersprungen werden. {sorted.map(q => ( onAnswer(q.id, ans)} /> ))} {requiredUnanswered.length > 0 && ( {requiredUnanswered.length} Pflichtfeld{requiredUnanswered.length > 1 ? 'er fehlen' : ' fehlt'} noch. )} {onReparse && ( )} ) }