import Grid from '@material-ui/core/Grid'
import Table from '@material-ui/core/Table'
import TableBody from '@material-ui/core/TableBody'
import TableCell from '@material-ui/core/TableCell'
import TableContainer from '@material-ui/core/TableContainer'
import TableHead from '@material-ui/core/TableHead'
import TableRow from '@material-ui/core/TableRow'
import { makeStyles, withStyles } from '@material-ui/core/styles'
import * as R from 'ramda'
import React from 'react'
import TitleSection from 'src/components/layout/TitleSection'
import { H4, Label2, P, Info2 } from 'src/components/typography'
import styles from './Assets.styles'
const useStyles = makeStyles(styles)
const StyledCell = withStyles({
root: {
borderBottom: '4px solid white',
padding: 0,
paddingLeft: 20,
paddingRight: 20
}
})(TableCell)
const HeaderCell = withStyles({
root: {
borderBottom: '4px solid white',
padding: 0,
paddingLeft: 20,
paddingRight: 20,
backgroundColor: 'white'
}
})(TableCell)
const AssetsAmountTable = ({ title, data = [], numToRender }) => {
const classes = useStyles()
const totalAmount = R.compose(R.sum, R.map(R.path(['amount'])))(data) ?? 0
const currency = data[0]?.currency ?? ''
const selectAmountPrefix = it =>
it.direction === 'in' ? '+' : R.isNil(it.direction) ? '' : '-'
return (
<>
{asset.display} {`${selectAmountPrefix(asset)}
${formatCurrency(Math.abs(asset.amount))} ${
asset.currency
}`}{title}