import { CheckCircle, XCircle, AlertCircle, AlertTriangle } from 'lucide-react'; import ReactMarkdown from 'react-markdown'; import type { JudgeAudit } from '@/types'; import { cn, verdictColor } from '@/lib/utils'; import CharacterAvatar from '@/components/CharacterAvatar'; interface JudgeAuditPanelProps { audit: JudgeAudit | null; className?: string; } export default function JudgeAuditPanel({ audit, className }: JudgeAuditPanelProps) { if (!audit) return null; const hasCaveats = audit.verdict === 'accept' && audit.top_failure_reasons.length > 0; const VerdictIcon = hasCaveats ? AlertTriangle : audit.verdict === 'success' || audit.verdict === 'accept' ? CheckCircle : audit.verdict === 'failure' || audit.verdict === 'reject' ? XCircle : AlertCircle; const verdictLabel = hasCaveats ? 'Accept with caveats' : audit.verdict.charAt(0).toUpperCase() + audit.verdict.slice(1); const reasonsLabel = hasCaveats ? 'Caveats to address' : 'Failure Reasons'; const reasonsColor = hasCaveats ? 'text-judge' : 'text-destructive'; return (

Judge Aldric's Verdict

{verdictLabel}
{audit.judge_notes.length > 0 && (

Notes

{audit.judge_notes.map((note, i) => (

{children}

, h2: ({ children }) =>

{children}

, h3: ({ children }) =>

{children}

, p: ({ children }) =>

{children}

, ul: ({ children }) =>
    {children}
, ol: ({ children }) =>
    {children}
, li: ({ children }) =>
  • {children}
  • , strong: ({ children }) => {children}, hr: () =>
    , blockquote: ({ children }) =>
    {children}
    , }} > {note}
    ))}
    )} {audit.top_failure_reasons.length > 0 && (

    {reasonsLabel}

    )}
    ); }