import { formatNumber } from "~/lib/utils"; export interface BarChartData { label: string; value: number; maxValue?: number; color?: string; labelColor?: string; valuePrefix?: string; valueSuffix?: string; } interface CustomBarChartProps { data: BarChartData[]; title?: string; height?: string; barHeight?: string; showAxisLabels?: boolean; className?: string; loading?: boolean; } export function CustomBarChart({ data, title, height = "auto", barHeight = "h-6", showAxisLabels = true, className = "", loading = false, }: CustomBarChartProps) { // Calculate the maximum value across all data points for consistent scaling const globalMaxValue = Math.max( ...data.map((item) => item.maxValue || item.value) ); // Loading skeleton if (loading) { return (