import { Button, Tooltip, TooltipContent, TooltipTrigger } from 'ui' import { Activity, BarChartIcon, GitCommitHorizontalIcon, InfoIcon } from 'lucide-react' import Link from 'next/link' export interface ChartHeaderProps { title?: string format?: string | ((value: unknown) => string) customDateFormat?: string minimalHeader?: boolean displayDateInUtc?: boolean highlightedLabel?: number | string | any | null highlightedValue?: number | string | any | null hideHighlightedValue?: boolean hideChartType?: boolean chartStyle?: string onChartStyleChange?: (style: string) => void showMaxValue?: boolean setShowMaxValue?: (value: boolean) => void docsUrl?: string } const ChartHeader = ({ format, highlightedValue, highlightedLabel, hideHighlightedValue = false, title, minimalHeader = false, hideChartType = false, chartStyle = 'bar', onChartStyleChange, showMaxValue = false, setShowMaxValue, docsUrl, }: ChartHeaderProps) => { const chartTitle = (

{title}

{docsUrl && ( Read docs )}
) const highlighted = (

{highlightedValue !== undefined && highlightedValue} {format === 'seconds' ? ' ' : ''} {typeof format === 'function' ? format(highlightedValue) : format}

) const label =

{highlightedLabel}

if (minimalHeader) { return (
{title && chartTitle}
{highlightedValue !== undefined && !hideHighlightedValue && highlighted} {label}
) } return (
{title && chartTitle} {highlightedValue !== undefined && !hideHighlightedValue && highlighted} {label}
{!hideChartType && onChartStyleChange && (
) } export default ChartHeader