chore: linting

This commit is contained in:
zhom
2026-03-09 15:09:25 +04:00
parent 478553a4a8
commit 3669d63ddf
2 changed files with 12 additions and 5 deletions
+5 -1
View File
@@ -11,6 +11,10 @@ import {
XAxis,
YAxis,
} from "recharts";
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent";
import type { TooltipContentProps } from "recharts/types/component/Tooltip";
import {
Dialog,
@@ -192,7 +196,7 @@ export function TrafficDetailsDialog({
// Tooltip render function
const renderTooltip = React.useCallback(
(props: TooltipContentProps<number, string>) => {
(props: TooltipContentProps<ValueType, NameType>) => {
const { active, payload, label } = props;
if (!active || !payload?.length) return null;
+7 -4
View File
@@ -6,7 +6,10 @@ import type {
Props as DefaultLegendContentProps,
LegendPayload,
} from "recharts/types/component/DefaultLegendContent";
import type { Payload } from "recharts/types/component/DefaultTooltipContent";
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent";
import type { TooltipContentProps } from "recharts/types/component/Tooltip";
import { cn } from "@/lib/utils";
@@ -111,7 +114,7 @@ const ChartTooltip = RechartsPrimitive.Tooltip;
const ChartTooltipContent = React.forwardRef<
HTMLDivElement,
TooltipContentProps<number, string> &
TooltipContentProps<ValueType, NameType> &
React.ComponentProps<"div"> & {
hideLabel?: boolean;
hideIndicator?: boolean;
@@ -195,8 +198,8 @@ const ChartTooltipContent = React.forwardRef<
{!nestLabel ? tooltipLabel : null}
<div className="grid gap-1.5">
{payload
.filter((item: Payload<number, string>) => item.type !== "none")
.map((item: Payload<number, string>, index: number) => {
.filter((item) => item.type !== "none")
.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;