feat(transactions): add live energy and estimated cost to transaction data
This commit is contained in:
@@ -153,10 +153,32 @@ export default function TransactionsPage() {
|
||||
{formatDuration(tx.startTimestamp, tx.stopTimestamp)}
|
||||
</Table.Cell>
|
||||
<Table.Cell className="tabular-nums">
|
||||
{tx.energyWh != null ? (tx.energyWh / 1000).toFixed(3) : "—"}
|
||||
{tx.energyWh != null ? (
|
||||
(tx.energyWh / 1000).toFixed(3)
|
||||
) : tx.liveEnergyWh != null ? (
|
||||
<span className="inline-flex items-center gap-1">
|
||||
{(tx.liveEnergyWh / 1000).toFixed(3)}
|
||||
<span className="rounded bg-warning-soft px-1 py-0.5 text-[10px] font-semibold text-warning leading-none text-nowrap">
|
||||
预估
|
||||
</span>
|
||||
</span>
|
||||
) : (
|
||||
"—"
|
||||
)}
|
||||
</Table.Cell>
|
||||
<Table.Cell className="tabular-nums">
|
||||
{tx.chargeAmount != null ? `¥${(tx.chargeAmount / 100).toFixed(2)}` : "—"}
|
||||
{tx.chargeAmount != null ? (
|
||||
`¥${(tx.chargeAmount / 100).toFixed(2)}`
|
||||
) : tx.estimatedCost != null ? (
|
||||
<span className="inline-flex items-center gap-1">
|
||||
¥{(tx.estimatedCost / 100).toFixed(2)}
|
||||
<span className="rounded bg-warning-soft px-1 py-0.5 text-[10px] font-semibold text-warning leading-none text-nowrap">
|
||||
预估
|
||||
</span>
|
||||
</span>
|
||||
) : (
|
||||
"—"
|
||||
)}
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
{tx.stopReason ? (
|
||||
|
||||
Reference in New Issue
Block a user