2023-03-20 12:29:05 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
2024-01-13 03:24:57 +00:00
|
|
|
import StatusQ 0.1
|
2023-03-20 12:29:05 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
ShowcaseDelegate {
|
2024-01-13 03:24:57 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property var formatCurrencyAmount: function(amount, symbol){}
|
|
|
|
property double totalValue: !!showcaseObj && !!showcaseObj.decimals ? balancesAggregator.value/(10 ** showcaseObj.decimals): 0
|
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
title: !!showcaseObj && !!showcaseObj.name ? showcaseObj.name : ""
|
2024-01-13 03:24:57 +00:00
|
|
|
secondaryTitle: !!showcaseObj && !!showcaseObj.enabledNetworkBalance ?
|
|
|
|
LocaleUtils.currencyAmountToLocaleString(showcaseObj.enabledNetworkBalance) :
|
|
|
|
!!showcaseObj && !!showcaseObj.symbol ? formatCurrencyAmount(totalValue, showcaseObj.symbol): Qt.locale().zeroDigit
|
2023-03-20 12:29:05 +00:00
|
|
|
hasImage: true
|
|
|
|
icon.source: !!showcaseObj ? Constants.tokenIcon(showcaseObj.symbol) : ""
|
2024-01-13 03:24:57 +00:00
|
|
|
|
|
|
|
SumAggregator {
|
|
|
|
id: balancesAggregator
|
|
|
|
model: !!showcaseObj && !!showcaseObj.balances ? showcaseObj.balances: null
|
|
|
|
roleName: "balance"
|
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|