添加网球详情
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user