Show amountSats as title of expense item amounts

This commit is contained in:
2025-01-20 15:45:36 -05:00
parent aad2aaecd1
commit f02e5572ba
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
<span class="date">{{fmt-date-localized expense.date}}:</span>
<span class="title">{{expense.title}}</span>
</h4>
<div class="amount">
<div class="amount" title="{{fmt-amount-sats-title expense.amountSats}}">
{{fmt-fiat-currency expense.amount expense.currency}}
</div>
<p class="description">
+11
View File
@@ -0,0 +1,11 @@
import { helper } from '@ember/component/helper';
export default helper(function fmtAmountSatsTitle(params) {
const amountSats = params[0];
if (typeof amountSats === 'number' && amountSats > 0) {
return `${amountSats} sats`;
} else {
return '';
}
});