Fix TS errors: vite/client types + recharts Tooltip formatter signature

This commit is contained in:
jtricerolph 2026-07-23 09:07:34 +00:00
parent 2e0592eb90
commit 32318aa63f
4 changed files with 5 additions and 4 deletions

View file

@ -206,7 +206,7 @@ export default function Monthly() {
<BarChart data={weeks} margin={{ top: 4, right: 16, left: 16, bottom: 0 }}>
<XAxis dataKey="label" tick={{ fontSize: 12 }} />
<YAxis tickFormatter={v => `£${Math.round(v / 1000)}k`} tick={{ fontSize: 11 }} width={55} />
<Tooltip formatter={(v: number) => fmtMoney(v)} />
<Tooltip formatter={(v: unknown) => fmtMoney(Number(v))} />
<Legend />
{deptSummary.map(dep => (
<Bar key={dep.department_id} dataKey={dep.department_name} stackId="a" fill={dep.color}>

View file

@ -136,7 +136,7 @@ export default function Rolling12Months() {
<BarChart data={chartData} margin={{ top: 4, right: 16, left: 16, bottom: 0 }}>
<XAxis dataKey="label" tick={{ fontSize: 10 }} />
<YAxis tickFormatter={v => `£${Math.round(v / 1000)}k`} tick={{ fontSize: 11 }} width={55} />
<Tooltip formatter={(v: number) => fmtMoney(v)} />
<Tooltip formatter={(v: unknown) => fmtMoney(Number(v))} />
<Legend />
{deptCols.map(dep => (
<Bar key={dep.id} dataKey={dep.name} stackId="a" fill={dep.color} />

View file

@ -143,7 +143,7 @@ export default function Rolling12Weeks() {
<BarChart data={chartData} margin={{ top: 4, right: 16, left: 16, bottom: 0 }}>
<XAxis dataKey="label" tick={{ fontSize: 10 }} />
<YAxis tickFormatter={v => `£${Math.round(v / 1000)}k`} tick={{ fontSize: 11 }} width={55} />
<Tooltip formatter={(v: number) => fmtMoney(v)} />
<Tooltip formatter={(v: unknown) => fmtMoney(Number(v))} />
<Legend />
{deptCols.map(dep => (
<Bar key={dep.id} dataKey={dep.name} stackId="a" fill={dep.color} />

View file

@ -13,7 +13,8 @@
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": false,
"noUnusedParameters": false
"noUnusedParameters": false,
"types": ["vite/client"]
},
"include": ["src"]
}