/** * 报告详情页组件 */ import { useState } from 'react'; import { ArrowLeft, FileCheck, Tag } from 'lucide-react'; import type { ReviewReport } from '../types'; import EditorialReport from './EditorialReport'; import MethodologyReport from './MethodologyReport'; interface ReportDetailProps { report: ReviewReport; onBack: () => void; } export default function ReportDetail({ report, onBack }: ReportDetailProps) { const [activeTab, setActiveTab] = useState<'editorial' | 'methodology'>('editorial'); const hasEditorial = !!report.editorialReview; const hasMethodology = !!report.methodologyReview; // 如果只有方法学,默认显示方法学 const effectiveTab = activeTab === 'editorial' && !hasEditorial && hasMethodology ? 'methodology' : activeTab; return (
{/* 顶部导航栏 */}

{report.fileName} {report.overallScore && ( = 80 ? 'tag-green' : report.overallScore >= 60 ? 'tag-amber' : 'tag-red' }`}> {report.overallScore}分 )}

{/* 内容区域 */}
{/* Tab切换 */} {(hasEditorial || hasMethodology) && (
{hasEditorial && ( )} {hasMethodology && ( )}
)} {/* 报告内容 */} {effectiveTab === 'editorial' && report.editorialReview && ( )} {effectiveTab === 'methodology' && report.methodologyReview && ( )} {/* 无数据状态 */} {!hasEditorial && !hasMethodology && (

暂无评估报告

)}
); }