import Link from 'next/link' import { Table } from '@components/TransactionTable/Table' import { StyleAddress } from '@components/misc/StyleAddress' import { IconAndAmount } from '@components/misc/IconAndAmount' import { ChainInfo } from '@components/misc/ChainInfo' import { addressToSymbol } from '@utils/addressToSymbol' import Arrow from '@components/icons/Arrow' import { timeAgo } from '@utils/timeAgo' import { formatDate } from '@utils/formatDate' import { getBridgeTransactionUrl } from '@urls' export const BridgeTransactionTable = ({ queryResult }) => { const tableRows = [] queryResult?.map((txn) => { const { kappa, pending, fromInfo, toInfo } = txn const items = [
{new Date(fromInfo.time * 1000).toDateString() === new Date().toDateString() ? 'Today' : formatDate( new Date(fromInfo.time * 1000).toISOString().split('T')[0] )} {new Date(fromInfo.time * 1000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', })}
{pending ? ( ) : fromInfo.address === toInfo.address ? ( to Self ) : ( )}
{fromInfo.time ? timeAgo({ timestamp: fromInfo.time }) + ' ago' : timeAgo({ timestamp: toInfo?.time }) + ' ago'}
▶
, ] const row = { items, key: kappa, } tableRows.push(row) }) return }