{data.data.map((item, index) => {
const Icon = (Icons[
item.category.icon as keyof typeof Icons
] || Icons.HelpCircle) as LucideIcon;
const percentageChange =
item.previous_amount > 0
? ((item.amount - item.previous_amount) /
item.previous_amount) *
100
: null;
const categoryColor = getCategoryColorClasses(
item.category.color,
);
const chartColor =
CHART_COLORS[index % CHART_COLORS.length];
return (
{item.category.name}
{percentageChange !== null && (
)}
{item.percentage.toFixed(0)}%
);
})}
{data.data.length === 0 && (
{emptyMessage}
)}