'use client'
import type { AdvisorResponse } from '@/lib/sdk/advisor/contract'
import type { AdvisorCase } from './useAdvisorCase'
import { ClarifyView } from './ClarifyView'
import { EvidenceSummary } from './EvidenceSummary'
import { EvidencePane } from './EvidencePane'
import { VisualEvidencePane } from './VisualEvidencePane'
import { FootnotesPane } from './FootnotesPane'
import { Markdown } from './Markdown'
import { useCitationHighlight } from './useCitationHighlight'
export function LoadingDots() {
return (
)
}
export function ErrorBox({ msg }: { msg?: string }) {
return (
{msg || 'Verbindung fehlgeschlagen'}
)
}
/** Answer mode body (stacked): summary + answer (with [n] coupling) + evidence/visual/footnotes. */
export function AnswerBody({ response }: { response: AdvisorResponse }) {
const { highlightedId, cite } = useCitationHighlight(response.citations)
return (
)
}
/** One case rendered stacked (narrow mode). Clarify -> L1 + chips; answer -> full evidence body. */
export function CaseView({
c,
onSelectContext,
busy,
showQuestion,
}: {
c: AdvisorCase
onSelectContext: (ctx: string) => void
busy: boolean
showQuestion?: boolean
}) {
const r = c.response
return (
{showQuestion && (
Frage: {c.question}
)}
{c.status === 'loading' &&
}
{c.status === 'error' &&
}
{r && r.mode === 'clarify' && (
)}
{r && r.mode === 'answer' &&
}
)
}