import { PoolTransaction } from '@oceanprotocol/lib/dist/node/balancer/OceanPool' import { useMetadata, useOcean } from '@oceanprotocol/react' import { Link } from 'gatsby' import React, { ReactElement, useEffect, useState } from 'react' import DataTable from 'react-data-table-component' import EtherscanLink from '../../atoms/EtherscanLink' import Time from '../../atoms/Time' import styles from './PoolTransactions.module.css' function AssetTitle({ did }: { did: string }): ReactElement { const { title } = useMetadata(did) return {title || did} } const columns = [ { name: 'Title', selector: function getTitleRow(row: PoolTransaction) { // TODO: replace hardcoded symbol with symbol fetching based // on row.tonenIn & row.tokenOut const title = row.tokenAmountIn ? `Add ${row.tokenAmountIn} OCEAN` : `Remove ${row.tokenAmountOut} OCEAN` return ( {title} ) } }, { name: 'Data Set', selector: function getAssetRow(row: PoolTransaction) { const did = row.dtAddress.replace('0x', 'did:op:') return } }, { name: 'Time', selector: function getTimeRow(row: PoolTransaction) { return (