import { CLabelProps } from "@/src/types"; const renderCustomLabel = ({ cx = 0, cy = 0, midAngle = 0, innerRadius = 0, outerRadius = 0, percent = 0, }: CLabelProps) => { if (percent < 0.05) return null; const RADIAN = Math.PI / 180; const radius = innerRadius + (outerRadius - innerRadius) * 0.5; const x = cx + radius * Math.cos(-midAngle * RADIAN); const y = cy + radius * Math.sin(-midAngle * RADIAN); return ( {`${(percent * 100).toFixed(0)}%`} ); }; export default renderCustomLabel;