Files
TanWenyan 306cb24c70 feat(frontend): integrate GraphRAG scored evaluation results
- Add getUnifiedEvaluationResults API function
- Extend ReviewPointsListProps with flowType, scoredResults, scoredSummary
- Add ScoredResultCard rendering for graphrag flow_type
- Modify reviews.tsx loader to call unified API
- Add scored evaluation component imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 09:42:30 +08:00

57 lines
1.5 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React from 'react';
import { ScoreBar } from './ScoreBar';
import { FieldResultList } from './FieldResultList';
interface ScoredResultCardProps {
result: {
evaluation_point_id: number;
code: string;
name: string;
passed: boolean;
machine_score: number; // e.g., 3
score: number; // e.g., 5 (full score from evaluation_points)
percentage: number;
total_score: number; // e.g., 60
total_weight: number; // e.g., 100
field_results: Array<{
field_path: string;
evaluation_as: string;
weight: number;
scored: number;
status: string;
value: string;
page?: string;
ai_feedback?: string;
}>;
missing_fields?: string[];
ai_suggestion?: string;
};
}
export function ScoredResultCard({ result }: ScoredResultCardProps) {
return (
<div className="scored-result-card" data-passed={result.passed}>
<div className="scored-result-card__header">
<span className="scored-result-card__code">{result.code}</span>
<span className="scored-result-card__name">{result.name}</span>
</div>
<ScoreBar
score={result.machine_score}
fullScore={result.score}
percentage={result.percentage}
passed={result.passed}
/>
<FieldResultList items={result.field_results} />
{result.ai_suggestion && (
<div className="scored-result-card__suggestion">
<strong>💡 </strong>
<span>{result.ai_suggestion}</span>
</div>
)}
</div>
);
}