diff --git a/frontend/src/components/TransactionItem.tsx b/frontend/src/components/TransactionItem.tsx index 17048a83..f51cdab8 100644 --- a/frontend/src/components/TransactionItem.tsx +++ b/frontend/src/components/TransactionItem.tsx @@ -1,4 +1,6 @@ import dayjs from "dayjs"; +import timezone from "dayjs/plugin/timezone"; +import utc from "dayjs/plugin/utc"; import { ArrowDownIcon, ArrowUpIcon, @@ -21,6 +23,9 @@ import { copyToClipboard } from "src/lib/clipboard"; import { cn } from "src/lib/utils"; import { Transaction } from "src/types"; +dayjs.extend(utc); +dayjs.extend(timezone); + type Props = { tx: Transaction; }; @@ -89,9 +94,14 @@ function TransactionItem({ tx }: Props) { type == "incoming" && "text-green-600 dark:color-green-400" )} > - {type == "outgoing" ? "-" : "+"} {Math.floor(tx.amount / 1000)} + {type == "outgoing" ? "-" : "+"} + {new Intl.NumberFormat(undefined, {}).format( + Math.floor(tx.amount / 1000) + )}{" "} +
++ {Math.floor(tx.amount / 1000) == 1 ? "sat" : "sats"}
-sats
{/* {!!tx.totalAmountFiat && (@@ -130,7 +140,9 @@ function TransactionItem({ tx }: Props) {
- {Math.floor(tx.amount / 1000)}{" "} + {new Intl.NumberFormat(undefined, {}).format( + Math.floor(tx.amount / 1000) + )}{" "} {Math.floor(tx.amount / 1000) == 1 ? "sat" : "sats"}
{/*@@ -141,14 +153,18 @@ function TransactionItem({ tx }: Props) {
Date & Time
- {dayjs(tx.settled_at * 1000).toString()} + {dayjs(tx.settled_at * 1000) + .tz(dayjs.tz.guess()) + .format("D MMMM YYYY, HH:mm")}
Fee
- {Math.floor(tx.fees_paid / 1000)}{" "} + {new Intl.NumberFormat(undefined, {}).format( + Math.floor(tx.fees_paid / 1000) + )}{" "} {Math.floor(tx.fees_paid / 1000) == 1 ? "sat" : "sats"}