Skip to content

Commit dc8cfca

Browse files
committed
fix: TS errors
1 parent 90e5b2f commit dc8cfca

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

frontend/src/components/BarChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const CustomTooltipContent: FC<CustomTooltipContentProps> = (props) => {
7171
return {
7272
...entry,
7373
value: `: ${Math.round(entry.value * 10) / 10}%`,
74+
graphicalItemId: entry.key,
7475
}
7576
})
7677
return <ChartTooltipContent {...props} payload={newPayload} className="bg-black" />

frontend/src/components/ErrorAlert.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next'
22
import { Alert, AlertDescription, AlertTitle } from './ui/alert'
33

44
interface Props {
5-
error?: Error
5+
error?: unknown
66
}
77

88
export default function ErrorAlert({ error }: Props) {
@@ -22,7 +22,7 @@ export default function ErrorAlert({ error }: Props) {
2222
{error !== undefined && (
2323
<p>
2424
Please include the following error message:
25-
<span className="block font-mono border-1 border-neutral-700 p-1 rounded mt-1">{error.message}</span>
25+
<span className="block font-mono border-1 border-neutral-700 p-1 rounded mt-1">{error instanceof Error ? error.message : String(error)}</span>
2626
</p>
2727
)}
2828
</AlertDescription>

frontend/src/components/PercentageBarChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const CustomTooltipContent = (props: CustomTooltipContentProps) => {
4040
const newPayload = payload.map((entry) => ({
4141
...entry,
4242
value: `${entry.value * 100}%`,
43+
graphicalItemId: entry.key,
4344
}))
4445
return <ChartTooltipContent {...props} payload={newPayload} />
4546
}

0 commit comments

Comments
 (0)