/* * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC * SPDX-FileCopyrightText: 2026 Coffey Labs * * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL * * Modified by Coffey Labs in 2026 for INBUXA. */ import * as React from 'react'; import { Tooltip as RechartsTooltip } from 'recharts'; import type { TooltipPayload } from 'recharts/types/state/tooltipSlice'; import { cn } from '@/lib/utils'; export const CHART_COLORS = [ 'var(--chart-1)', 'var(--chart-2)', 'var(--chart-3)', 'var(--chart-4)', 'var(--chart-5)', ] as const; export function getChartColor(index: number): string { return CHART_COLORS[index % CHART_COLORS.length]; } export function ChartContainer({ children, className }: { children: React.ReactNode; className?: string }) { return
{children}
; } export function ChartTooltipContent({ active, payload, label, formatter, }: { active?: boolean; payload?: TooltipPayload; label?: string; formatter?: (value: number) => string; }) { if (!active || !payload?.length) return null; return (
{label &&

{label}

} {payload.map((entry, i) => (
{entry.name ?? ''} {formatter && typeof entry.value === 'number' ? formatter(entry.value) : String(entry.value ?? '')}
))}
); } export { RechartsTooltip };