From 4c744650751913dda236f23a195661f4d7153e61 Mon Sep 17 00:00:00 2001 From: icy Date: Tue, 4 Nov 2025 02:08:38 +0800 Subject: [PATCH] =?UTF-8?q?Add=20NOFX=20watermarks=20to=20charts=20and=20f?= =?UTF-8?q?ix=20empty=20state=20internationalization=20-=20Add=20NOFX=20wa?= =?UTF-8?q?termark=20to=20ComparisonChart=20(competition=20page)=20-=20Add?= =?UTF-8?q?=20NOFX=20watermark=20to=20EquityChart=20(dashboard=20page)=20-?= =?UTF-8?q?=20Fix=20empty=20state=20handling=20and=20internationalization?= =?UTF-8?q?=20in=20CompetitionPage=20=F0=9F=A4=96=20Generated=20with=20[Cl?= =?UTF-8?q?aude=20Code](https://claude.ai/code)=20Co-Authored-By:=20tinkle?= =?UTF-8?q?-community=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/ComparisonChart.tsx | 18 ++++++++++- web/src/components/CompetitionPage.tsx | 43 +++++++++++++++++++++++++- web/src/components/EquityChart.tsx | 18 ++++++++++- 3 files changed, 76 insertions(+), 3 deletions(-) diff --git a/web/src/components/ComparisonChart.tsx b/web/src/components/ComparisonChart.tsx index 600421a3..7a933920 100644 --- a/web/src/components/ComparisonChart.tsx +++ b/web/src/components/ComparisonChart.tsx @@ -233,7 +233,23 @@ export function ComparisonChart({ traders }: ComparisonChartProps) { return (
-
+
+ {/* NOFX Watermark */} +
+ NOFX +
diff --git a/web/src/components/CompetitionPage.tsx b/web/src/components/CompetitionPage.tsx index 3168bd14..d719472e 100644 --- a/web/src/components/CompetitionPage.tsx +++ b/web/src/components/CompetitionPage.tsx @@ -41,7 +41,7 @@ export function CompetitionPage() { setSelectedTrader(null); }; - if (!competition || !competition.traders) { + if (!competition) { return (
@@ -64,6 +64,47 @@ export function CompetitionPage() { ); } + // 如果有数据返回但没有交易员,显示空状态 + if (!competition.traders || competition.traders.length === 0) { + return ( +
+ {/* Competition Header - 精简版 */} +
+
+
+ +
+
+

+ {t('aiCompetition', language)} + + 0 {t('traders', language)} + +

+

+ {t('liveBattle', language)} +

+
+
+
+ + {/* Empty State */} +
+ +

+ {t('noTraders', language)} +

+

+ {t('createFirstTrader', language)} +

+
+
+ ); + } + // 按收益率排序 const sortedTraders = [...competition.traders].sort( (a, b) => b.total_pnl_pct - a.total_pnl_pct diff --git a/web/src/components/EquityChart.tsx b/web/src/components/EquityChart.tsx index bfa89617..e7441779 100644 --- a/web/src/components/EquityChart.tsx +++ b/web/src/components/EquityChart.tsx @@ -270,7 +270,23 @@ export function EquityChart({ traderId }: EquityChartProps) {
{/* Chart */} -
+
+ {/* NOFX Watermark */} +
+ NOFX +