mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 06:11:12 -05:00
feat: Enable TypeScript strict mode
This commit is contained in:
@@ -91,14 +91,7 @@ const ChartTooltip = RechartsPrimitive.Tooltip;
|
||||
|
||||
const ChartTooltipContent = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
||||
React.ComponentProps<"div"> & {
|
||||
hideLabel?: boolean;
|
||||
hideIndicator?: boolean;
|
||||
indicator?: "line" | "dot" | "dashed";
|
||||
nameKey?: string;
|
||||
labelKey?: string;
|
||||
}
|
||||
import('@/types/recharts').TooltipProps
|
||||
>(
|
||||
(
|
||||
{
|
||||
@@ -115,7 +108,7 @@ const ChartTooltipContent = React.forwardRef<
|
||||
color,
|
||||
nameKey,
|
||||
labelKey,
|
||||
}: any,
|
||||
},
|
||||
ref,
|
||||
) => {
|
||||
const { config } = useChart();
|
||||
@@ -163,7 +156,11 @@ const ChartTooltipContent = React.forwardRef<
|
||||
{payload.map((item, index) => {
|
||||
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
||||
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
||||
const indicatorColor = color || item.payload.fill || item.color;
|
||||
const indicatorColor = color ||
|
||||
(typeof item.payload === 'object' && item.payload !== null && 'fill' in item.payload
|
||||
? (item.payload as Record<string, unknown>).fill as string
|
||||
: undefined) ||
|
||||
item.color;
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -229,12 +226,7 @@ const ChartLegend = RechartsPrimitive.Legend;
|
||||
|
||||
const ChartLegendContent = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.ComponentProps<"div"> & {
|
||||
hideIcon?: boolean;
|
||||
nameKey?: string;
|
||||
payload?: any[];
|
||||
verticalAlign?: "top" | "bottom";
|
||||
}
|
||||
import('@/types/recharts').LegendProps
|
||||
>(({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
|
||||
const { config } = useChart();
|
||||
|
||||
@@ -247,7 +239,7 @@ const ChartLegendContent = React.forwardRef<
|
||||
ref={ref}
|
||||
className={cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className)}
|
||||
>
|
||||
{payload.map((item: any) => {
|
||||
{payload.map((item) => {
|
||||
const key = `${nameKey || item.dataKey || "value"}`;
|
||||
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user