添加网球详情

This commit is contained in:
yuchenglong
2026-01-22 18:48:39 +08:00
parent a279083252
commit c63753e631
16 changed files with 1142 additions and 32 deletions

View File

@@ -87,12 +87,13 @@ export function StatsCard({ match, isDark }: StatsCardProps) {
const progressPercent = Math.min(100, (totalSeconds / (90 * 60)) * 100);
// 从 statistics 中提取数据
const stats = match.statistics || [];
const stats = (match.statistics || []) as any[];
const getStatValue = (type: string) => {
const stat = stats.find((s) => s.type === type);
return stat
? { home: stat.home, away: stat.away }
: { home: "0", away: "0" };
if (stat && stat.home) {
return { home: stat.home, away: stat.away };
}
return { home: "0", away: "0" };
};
const possession = getStatValue("Ball Possession");