"use client"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; import type { ReportData } from "@/lib/types"; function stripThinkTags(text: string): string { return text.replace(/[\s\S]*?<\/think>/g, "").trim(); } export default function ReportView({ report }: { report: ReportData }) { const text = stripThinkTags(report.text ?? ""); const hypotheses = report.hypotheses ?? []; return (
(
{children}
), thead: ({ children }) => {children}, tbody: ({ children }) => {children}, tr: ({ children }) => {children}, th: ({ children }) => {children}, td: ({ children }) => {children}, h1: ({ children }) =>

{children}

, h2: ({ children }) =>

{children}

, h3: ({ children }) =>

{children}

, p: ({ children }) =>

{children}

, ul: ({ children }) =>
    {children}
, ol: ({ children }) =>
    {children}
, li: ({ children }) =>
  • {children}
  • , strong: ({ children }) => {children}, hr: () =>
    , code: ({ children }) => {children}, blockquote: ({ children }) =>
    {children}
    , }}> {text}
    {hypotheses.length > 0 && (
    Hypotheses ({hypotheses.length})
    {hypotheses.map((h) => (
    {h.status === "confirmed" ? "โœ…" : "๐Ÿ”"} [{h.id}] {" "}{h.description}
    ))}
    )}

    {report.evidence_count} tool calls ยท {hypotheses.length} hypotheses {report.error && โš  {report.error}}

    ); }