From 4111d8d323d9900883572ec9c7d8ddbd41398325 Mon Sep 17 00:00:00 2001 From: katty barroso Date: Wed, 4 Dec 2024 15:30:44 +0100 Subject: [PATCH] Update data asset transations table --- .../components/Report/AssetTransactions.tsx | 44 +++++-------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/centrifuge-app/src/components/Report/AssetTransactions.tsx b/centrifuge-app/src/components/Report/AssetTransactions.tsx index 86209f59ec..e8daefb6de 100644 --- a/centrifuge-app/src/components/Report/AssetTransactions.tsx +++ b/centrifuge-app/src/components/Report/AssetTransactions.tsx @@ -1,7 +1,8 @@ import { Pool } from '@centrifuge/centrifuge-js' -import { formatBalance, useGetExplorerUrl } from '@centrifuge/centrifuge-react' +import { useGetExplorerUrl } from '@centrifuge/centrifuge-react' import { Box, IconAnchor, IconExternalLink, Text } from '@centrifuge/fabric' import * as React from 'react' +import { formatBalance } from '../../../src/utils/formatting' import { formatDate } from '../../utils/date' import { getCSVDownloadUrl } from '../../utils/getCSVDownloadUrl' import { useAssetTransactions } from '../../utils/usePools' @@ -21,53 +22,35 @@ export function AssetTransactions({ pool }: { pool: Pool }) { const columnConfig = [ { - header: 'Asset ID', - align: 'center', - csvOnly: false, - formatter: noop, - width: '80px', - }, - { - header: 'Asset name', - align: 'left', - csvOnly: false, - formatter: noop, - }, - { - header: 'Epoch', - align: 'center', - csvOnly: false, - formatter: noop, - }, - { - header: 'Date', + header: 'Transaction date', align: 'left', csvOnly: false, formatter: formatDate, }, { - header: 'Transaction type', + header: 'Transaction', align: 'left', csvOnly: false, formatter: noop, + width: '38%', }, { - header: 'Currency amount', + header: 'Amount', align: 'left', csvOnly: false, formatter: (v: any) => (typeof v === 'number' ? formatBalance(v, pool.currency.symbol, 2) : '-'), }, { - header: 'Currency', - align: 'left', - csvOnly: true, + header: 'Epoch', + align: 'center', + csvOnly: false, formatter: noop, }, { - header: 'Transaction', + header: 'View transaction', align: 'center', csvOnly: false, - width: '80px', + width: '120px', formatter: (v: any) => ( ({ name: '', value: [ - tx.asset.id.split('-').at(-1)!, - tx.asset.name || `Asset ${tx.asset.id.split('-').at(-1)!}`, - tx.epochId.split('-').at(-1)!, tx.timestamp.toISOString(), formatAssetTransactionType(tx.type), tx.amount?.toFloat() ?? '', - pool.currency.symbol, + tx.epochId.split('-').at(-1)!, tx.hash, ], heading: false,