306cb24c70
- 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>
33 lines
1001 B
TypeScript
33 lines
1001 B
TypeScript
import React from 'react';
|
|
|
|
interface ScoreBarProps {
|
|
score: number; // Actual score (e.g., 3 for 3/5)
|
|
fullScore: number; // Max score (e.g., 5)
|
|
percentage: number; // 0.0-1.0
|
|
passed: boolean;
|
|
}
|
|
|
|
export function ScoreBar({ score, fullScore, percentage, passed }: ScoreBarProps) {
|
|
const pct = Math.round(percentage * 100);
|
|
|
|
return (
|
|
<div className="score-bar" data-passed={passed}>
|
|
<div className="score-bar__header">
|
|
<span className="score-bar__percentage">{pct}%</span>
|
|
<span className={`score-bar__status ${passed ? 'passed' : 'failed'}`}>
|
|
{passed ? '✅ 通过' : '❌ 未通过'}
|
|
</span>
|
|
</div>
|
|
<div className="score-bar__track">
|
|
<div
|
|
className={`score-bar__fill ${passed ? 'passed' : 'failed'}`}
|
|
style={{ width: `${pct}%` }}
|
|
/>
|
|
</div>
|
|
<div className="score-bar__footer">
|
|
得分 {score.toFixed(1)} / 满分 {fullScore.toFixed(1)}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|