import { toUnit } from '@lamassu/coins/lightUtils'
import BigNumber from 'bignumber.js'
import * as R from 'ramda'
import React from 'react'
import DataTable from '../../../components/tables/DataTable'
import { H3, H4, Label1, Label2, P } from '../../../components/typography'
import TxInIcon from '../../../styling/icons/direction/cash-in.svg?react'
import TxOutIcon from '../../../styling/icons/direction/cash-out.svg?react'
import { ifNotNull } from '../../../utils/nullCheck'
import { formatDate } from '../../../utils/timezones'
import CopyToClipboard from '../../../components/CopyToClipboard.jsx'
const TransactionsList = ({ customer, data, loading }) => {
const LastTxIcon = customer.lastTxClass === 'cashOut' ? TxOutIcon : TxInIcon
const hasData = !(R.isEmpty(data) || R.isNil(data))
const { lastUsedMachineName } = customer
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
const summaryElements = [
{
header: 'Transactions',
size: 127,
value: ifNotNull(
customer.totalTxs,
`${Number.parseInt(customer.totalTxs)}`,
),
},
{
header: 'Transaction volume',
size: 167,
value: ifNotNull(
customer.totalSpent,
`${Number.parseFloat(customer.totalSpent)} ${customer.lastTxFiatCode}`,
),
},
{
header: 'Last active',
size: 142,
value:
!R.isNil(timezone) &&
((customer.lastActive &&
formatDate(customer.lastActive, timezone, 'yyyy-MM-dd')) ??
''),
},
{
header: 'Last transaction',
size: 198,
value: ifNotNull(
customer.lastTxFiat,
<>
{value}
))}