From fe78f96400fb4ea786a34ac3e494b9e1f8a2c40c Mon Sep 17 00:00:00 2001 From: Pontus Abrahamsson Date: Tue, 19 Dec 2023 11:08:31 +0100 Subject: [PATCH] Inbox --- .../src/components/charts/bar-chart.tsx | 19 +++++++++++-------- .../components/charts/transactions-list.tsx | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/apps/dashboard/src/components/charts/bar-chart.tsx b/apps/dashboard/src/components/charts/bar-chart.tsx index 91f2b5750b..cd0dd5480a 100644 --- a/apps/dashboard/src/components/charts/bar-chart.tsx +++ b/apps/dashboard/src/components/charts/bar-chart.tsx @@ -140,14 +140,17 @@ export function BarChart({ data }) { fontSize={12} tickLine={false} axisLine={false} - tickFormatter={(value) => - formatAmount({ - maximumFractionDigits: 0, - minimumFractionDigits: 0, - currency: data.summary.currency, - amount: value, - }) - } + tickFormatter={(value) => { + if (data.summary.currency) { + return formatAmount({ + maximumFractionDigits: 0, + minimumFractionDigits: 0, + currency: data.summary.currency, + amount: value, + }); + } + return 0; + }} tick={{ fill: "#606060", fontSize: 12, diff --git a/apps/dashboard/src/components/charts/transactions-list.tsx b/apps/dashboard/src/components/charts/transactions-list.tsx index 317aa3d49a..bffe4c887f 100644 --- a/apps/dashboard/src/components/charts/transactions-list.tsx +++ b/apps/dashboard/src/components/charts/transactions-list.tsx @@ -47,6 +47,14 @@ export async function TransactionsList({ type, disabled }) { }, }); + if (!data?.length) { + return ( +
+

No transactions found

+
+ ); + } + return (