Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jlvandenhout committed Nov 8, 2023
1 parent 5adcb2a commit 4d921bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/ManaCalculator/components/CharTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import React from 'react';
import { TooltipProps } from 'recharts';
import { getSizeOfUnit, Unit } from '../hooks';

export function chartTooltip(xLabel: string, yLabel: string, unit: Unit) {
const unitSize = getSizeOfUnit(unit);
return ({ active, payload, label }) => {

const ChartTooltip = ({
active,
payload,
label,
}: TooltipProps<number, string>) => {
if (active && payload && payload.length) {
const value = payload[0].value * unitSize;
return (
Expand All @@ -16,4 +22,6 @@ export function chartTooltip(xLabel: string, yLabel: string, unit: Unit) {

return null;
};

return ChartTooltip;
}

0 comments on commit 4d921bf

Please sign in to comment.