板球直播详情基本信息
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { CricketLiveBroadcast } from "@/components/live-detail/cricket/cricket-live-broadcast";
|
||||
import { EventsTimeline } from "@/components/live-detail/events-timeline";
|
||||
import { LiveLeagueInfo } from "@/components/live-detail/live-league-info";
|
||||
import { LiveMatchTabs } from "@/components/live-detail/live-match-tabs";
|
||||
@@ -11,6 +12,10 @@ import { TennisStatsCard } from "@/components/live-detail/tennis-stats-card";
|
||||
import { BasketballOverallStats } from "@/components/match-detail/basketball/basketball-overall-stats";
|
||||
import { BasketballScoreTable } from "@/components/match-detail/basketball/basketball-score-table";
|
||||
import { BasketballStats } from "@/components/match-detail/basketball/basketball-stats";
|
||||
import { CricketH2H } from "@/components/match-detail/cricket/cricket-h2h";
|
||||
import { CricketH2HCard } from "@/components/match-detail/cricket/cricket-h2h-card";
|
||||
import { CricketMatchInfoCard } from "@/components/match-detail/cricket/cricket-match-info-card";
|
||||
import { CricketTeamsCard } from "@/components/match-detail/cricket/cricket-teams-card";
|
||||
import { ThemedText } from "@/components/themed-text";
|
||||
import { ThemedView } from "@/components/themed-view";
|
||||
import { Colors } from "@/constants/theme";
|
||||
@@ -90,23 +95,36 @@ export default function LiveDetailScreen() {
|
||||
eventType: "",
|
||||
eventToss: "",
|
||||
eventManOfMatch: "",
|
||||
scores: Array.isArray(match.scores) && match.scores.length > 0 && 'type' in match.scores[0]
|
||||
? match.scores as { type: string; home: string; away: string; }[]
|
||||
: undefined,
|
||||
stats: Array.isArray(match.statistics) && match.statistics.length > 0 && 'type' in match.statistics[0]
|
||||
? match.statistics as { type: string; home: string; away: string; }[]
|
||||
: undefined,
|
||||
comments: match.comments,
|
||||
scorecard: match.scorecard,
|
||||
wickets: match.wickets,
|
||||
scores:
|
||||
Array.isArray(match.scores) &&
|
||||
match.scores.length > 0 &&
|
||||
"type" in match.scores[0]
|
||||
? (match.scores as { type: string; home: string; away: string }[])
|
||||
: undefined,
|
||||
stats:
|
||||
Array.isArray(match.statistics) &&
|
||||
match.statistics.length > 0 &&
|
||||
"type" in match.statistics[0]
|
||||
? (match.statistics as {
|
||||
type: string;
|
||||
home: string;
|
||||
away: string;
|
||||
}[])
|
||||
: undefined,
|
||||
players: match.player_statistics
|
||||
? {
|
||||
home_team: (match.player_statistics.home_team || []).map((p) => ({
|
||||
...p,
|
||||
player_oncourt: p.player_oncourt || undefined,
|
||||
})),
|
||||
away_team: (match.player_statistics.away_team || []).map((p) => ({
|
||||
...p,
|
||||
player_oncourt: p.player_oncourt || undefined,
|
||||
})),
|
||||
}
|
||||
home_team: (match.player_statistics.home_team || []).map((p) => ({
|
||||
...p,
|
||||
player_oncourt: p.player_oncourt || undefined,
|
||||
})),
|
||||
away_team: (match.player_statistics.away_team || []).map((p) => ({
|
||||
...p,
|
||||
player_oncourt: p.player_oncourt || undefined,
|
||||
})),
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
};
|
||||
@@ -179,6 +197,56 @@ export default function LiveDetailScreen() {
|
||||
(match.league_name &&
|
||||
/ATP|WTA|ITF|Challenger/i.test(match.league_name || ""));
|
||||
|
||||
if (numericSportId === 4 && convertToMatchDetailData) {
|
||||
// Cricket
|
||||
switch (activeTab) {
|
||||
case "detail":
|
||||
return (
|
||||
<>
|
||||
{/* Team Card */}
|
||||
<CricketTeamsCard
|
||||
data={convertToMatchDetailData}
|
||||
isDark={isDark}
|
||||
/>
|
||||
|
||||
{/* Live Broadcast Card */}
|
||||
<CricketLiveBroadcast
|
||||
data={convertToMatchDetailData}
|
||||
isDark={isDark}
|
||||
/>
|
||||
|
||||
{/* H2H Card */}
|
||||
<CricketH2HCard data={convertToMatchDetailData} isDark={isDark} />
|
||||
|
||||
{/* Match Info Card */}
|
||||
<CricketMatchInfoCard
|
||||
data={convertToMatchDetailData}
|
||||
isDark={isDark}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
case "h2h":
|
||||
return <CricketH2H data={convertToMatchDetailData} isDark={isDark} />;
|
||||
default:
|
||||
// Reuse generic logic for odds/chat if needed or show empty
|
||||
if (activeTab === "odds")
|
||||
return (
|
||||
<OddsCard
|
||||
match={match}
|
||||
isDark={isDark}
|
||||
sportId={numericSportId}
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<View style={styles.center}>
|
||||
<ThemedText style={{ opacity: 0.5 }}>
|
||||
{t("detail.empty_stats")}
|
||||
</ThemedText>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (numericSportId === 2 && convertToMatchDetailData) {
|
||||
switch (activeTab) {
|
||||
case "stats":
|
||||
|
||||
Reference in New Issue
Block a user