mars-v2-frontend/src/components/Borrow/Table/Columns/Debt.tsx
Bob van der Helm ccc4a42354
Full refactor tables (#556)
* 📈 Improve structure generic Table component

* ♻️ Update Borrow Table and overall structure of Table comp

* ♻️ Update Lend table

*  add loading state for lend table

* 🧪 Fix unit tests
2023-10-18 09:38:24 +02:00

23 lines
586 B
TypeScript

import React from 'react'
import AmountAndValue from 'components/AmountAndValue'
import { BN_ZERO } from 'constants/math'
import { getEnabledMarketAssets } from 'utils/assets'
export const DEBT_META = {
accessorKey: 'debt',
header: 'Debt',
}
interface Props {
data: BorrowMarketTableData
}
export default function Debt(props: Props) {
const marketAssets = getEnabledMarketAssets()
const asset = marketAssets.find((asset) => asset.denom === props.data.asset.denom)
if (!asset) return null
return <AmountAndValue asset={asset} amount={props.data?.debt ?? BN_ZERO} />
}