* add liquidation price to balances table trade * add depositcap to HLS * fix: add width classes to the balances table, remove abbreviation, remove flicker * fix: fixed the account selection and added a tooltip * fix wasm file for debt liquidation price --------- Co-authored-by: Linkie Link <linkielink.dev@gmail.com>
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import { ColumnDef } from '@tanstack/react-table'
|
|
import React, { useMemo } from 'react'
|
|
|
|
import Deposit, { DEPOSIT_META } from 'components/HLS/Farm/Table/Columns/Deposit'
|
|
import ApyRange, {
|
|
APY_RANGE_META,
|
|
apyRangeSortingFn,
|
|
} from 'components/HLS/Staking/Table/Columns/ApyRange'
|
|
import DepositCap, { CAP_META } from 'components/HLS/Staking/Table/Columns/DepositCap'
|
|
import MaxLeverage, { MAX_LEV_META } from 'components/HLS/Staking/Table/Columns/MaxLeverage'
|
|
import MaxLTV, { LTV_MAX_META } from 'components/HLS/Staking/Table/Columns/MaxLTV'
|
|
import Name, { NAME_META } from 'components/HLS/Staking/Table/Columns/Name'
|
|
|
|
interface Props {
|
|
isLoading: boolean
|
|
}
|
|
|
|
export default function useAvailableColumns(props: Props) {
|
|
return useMemo<ColumnDef<HLSStrategy>[]>(
|
|
() => [
|
|
{
|
|
...NAME_META,
|
|
cell: ({ row }) => <Name strategy={row.original as HLSStrategy} />,
|
|
},
|
|
{
|
|
...MAX_LEV_META,
|
|
cell: ({ row }) => <MaxLeverage strategy={row.original} />,
|
|
},
|
|
{
|
|
...LTV_MAX_META,
|
|
cell: ({ row }) => (
|
|
<MaxLTV strategy={row.original as HLSStrategy} isLoading={props.isLoading} />
|
|
),
|
|
},
|
|
{
|
|
...CAP_META,
|
|
cell: ({ row }) => <DepositCap depositCap={row.original.depositCap} />,
|
|
},
|
|
{
|
|
...APY_RANGE_META,
|
|
cell: ({ row }) => (
|
|
<ApyRange strategy={row.original as HLSStrategy} isLoading={props.isLoading} />
|
|
),
|
|
sortingFn: apyRangeSortingFn,
|
|
},
|
|
{
|
|
...DEPOSIT_META,
|
|
cell: ({ row }) => (
|
|
<Deposit strategy={row.original as HLSStrategy} isLoading={props.isLoading} />
|
|
),
|
|
},
|
|
],
|
|
[props.isLoading],
|
|
)
|
|
}
|