import React from "react"; import { formatNumber } from "~/lib/utils"; interface FunnelData { name: string; value: number; label: string; percentage?: string; } interface FunnelChartProps { data: FunnelData[]; title?: string; className?: string; } export function FunnelChart({ data, title, className = "" }: FunnelChartProps) { const maxValue = Math.max(...data.map(d => d.value)); const toPercent = (value: number) => { if (!maxValue || maxValue <= 0) return 0; return Math.round((value / maxValue) * 100); }; return (