Fix Finance page crash from Tooltip formatter returning array
CI / build-and-push (push) Successful in 34s
CI / build-and-push (push) Successful in 34s
Recharts Tooltip formatter should return a string, not a single-element array which React can't render as a child. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,7 @@ export function FinancePage() {
|
||||
<YAxis hide />
|
||||
<Tooltip
|
||||
contentStyle={{ backgroundColor: '#1e293b', border: '1px solid #334155', borderRadius: '8px' }}
|
||||
formatter={(v: number) => [formatMoney(v)]}
|
||||
formatter={(v: number) => formatMoney(v)}
|
||||
/>
|
||||
<Area type="monotone" dataKey="money" stroke="#6366f1" fill="url(#cashGrad)" />
|
||||
</AreaChart>
|
||||
@@ -94,7 +94,7 @@ export function FinancePage() {
|
||||
<YAxis hide />
|
||||
<Tooltip
|
||||
contentStyle={{ backgroundColor: '#1e293b', border: '1px solid #334155', borderRadius: '8px' }}
|
||||
formatter={(v: number) => [formatMoney(v)]}
|
||||
formatter={(v: number) => formatMoney(v)}
|
||||
/>
|
||||
<Line type="monotone" dataKey="revenue" stroke="#22c55e" dot={false} strokeWidth={2} />
|
||||
<Line type="monotone" dataKey="expenses" stroke="#ef4444" dot={false} strokeWidth={2} />
|
||||
|
||||
Reference in New Issue
Block a user