import { useTranslation } from "react-i18next"; import type { RecentTransaction } from "../../shared/types"; export interface HubTopTransactionsTileProps { transactions: RecentTransaction[]; limit?: number; } function formatAmount(amount: number, language: string): string { return new Intl.NumberFormat(language === "fr" ? "fr-CA" : "en-CA", { style: "currency", currency: "CAD", }).format(amount); } export default function HubTopTransactionsTile({ transactions, limit = 5, }: HubTopTransactionsTileProps) { const { t, i18n } = useTranslation(); const visible = transactions.slice(0, limit); return (
{t("reports.highlights.topTransactions")} {visible.length === 0 ? (

{t("reports.empty.noData")}

) : ( )}
); }