添加网球详情

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

@@ -262,14 +262,15 @@ export function MatchCard({
return { home: "", away: "" };
}
const corners = liveDetail.statistics.find((s) => s.type === "Corners");
// Cast statistics to any[] to avoid union type issues when accessing 'home'/'away' properties
const stats = liveDetail.statistics as any[];
const corners = stats.find((s) => s.type === "Corners");
if (corners) {
return { home: corners.home, away: corners.away };
}
const dangerousAttacks = liveDetail.statistics.find(
(s) => s.type === "Dangerous Attacks",
);
const dangerousAttacks = stats.find((s) => s.type === "Dangerous Attacks");
if (dangerousAttacks) {
return { home: dangerousAttacks.home, away: dangerousAttacks.away };
}