{#if props.transactions.length > 0} {#each props.transactions as transaction} {/each} {/if}
{$i18n.t('common:transactionTable.headerDate')} {$i18n.t('common:transactionTable.headerChargepoint')} {$i18n.t('common:transactionTable.headerEnergyTotal')} {$i18n.t('common:transactionTable.headerCost')}

{$i18n.t('common:transactionTable.startTime', { time: new Date(transaction.started_at), formatParams: { time: { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', }, }, })}

{$i18n.t('common:transactionTable.endTime', { time: new Date(transaction.ended_at!), formatParams: { time: { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', }, }, })}

{transaction.chargepoint.identity} {(transaction.meter_end - transaction.meter_start).toFixed(2)} kWh {((transaction.meter_end - transaction.meter_start) * transaction.price).toFixed(2)} € {$i18n.t('common:transactionTable.detailButton')}
{#if props.transactions.length === 0}

{$i18n.t('common:transactionTable.noPreviousTransactions')}

{/if}