fix: remove explicit type annotations on Recharts formatter callbacks

TypeScript strict mode in CI rejects explicit parameter types on
Recharts formatter/tickFormatter callbacks. Use inference with
'as number' casts on the value instead. Also fix unsafe cast in
PortfolioComposition and handle possibly-undefined percent.
This commit is contained in:
Celes Renata
2026-04-15 16:17:00 +00:00
parent 4ffde8cc06
commit 516731e69a
3 changed files with 7 additions and 7 deletions
@@ -50,7 +50,7 @@ export function PerformanceCharts() {
<Tooltip
contentStyle={tooltipStyle}
labelStyle={{ color: '#9ca3af' }}
formatter={(value: number) => [`${value.toFixed(2)}%`, 'Cumulative Return']}
formatter={(value) => [`${Number(value).toFixed(2)}%`, 'Cumulative Return']}
/>
<Line
type="monotone"
@@ -75,7 +75,7 @@ export function PerformanceCharts() {
<Tooltip
contentStyle={tooltipStyle}
labelStyle={{ color: '#9ca3af' }}
formatter={(value: number) => [`${value.toFixed(2)}%`, 'Daily Return']}
formatter={(value) => [`${Number(value).toFixed(2)}%`, 'Daily Return']}
/>
<Bar dataKey="dailyReturn" name="Daily Return">
{chartData.map((entry, i) => (
@@ -97,7 +97,7 @@ export function PerformanceCharts() {
<Tooltip
contentStyle={tooltipStyle}
labelStyle={{ color: '#9ca3af' }}
formatter={(value: number) => [`${value.toFixed(2)}%`, 'Drawdown']}
formatter={(value) => [`${Number(value).toFixed(2)}%`, 'Drawdown']}
/>
<Area
type="monotone"