import Link from "next/link"; import type { ReactNode } from "react"; import { formatPaymentBreakdownPercentage, formatPaymentBreakdownTransactionsLabel, } from "@/features/dashboard/payments/payment-breakdown-formatters"; import MoneyValues from "@/shared/components/money-values"; import { Progress } from "@/shared/components/ui/progress"; import { getCategoryBgColorFromName, getCategoryColorFromName, } from "@/shared/utils/category-colors"; export type PaymentBreakdownListItemData = { id: string; title: string; icon: ReactNode; amount: number; transactions: number; percentage: number; href?: string; }; type PaymentBreakdownListItemProps = { item: PaymentBreakdownListItemData; position: number; }; export function PaymentBreakdownListItem({ item, position, }: PaymentBreakdownListItemProps) { return (
{position}
{item.icon}
{item.href ? ( {item.title} ) : (

{item.title}

)}
{formatPaymentBreakdownTransactionsLabel(item.transactions)} {formatPaymentBreakdownPercentage(item.percentage)} do total
); }