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