lushdog@outlook.com 1 mese fa
parent
commit
25ad02fdea
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      src/app/components/DataTable.tsx

+ 4 - 0
src/app/components/DataTable.tsx

@@ -5,6 +5,7 @@ import { Table, message, Select, Typography, Tag, Button } from 'antd'
 
 interface TableData {
   key: string
+  liquidity: string
   earnedUsd: string
   positionAgeMs: number
   [key: string]: unknown
@@ -189,6 +190,9 @@ export default function DataTable() {
       title: 'Liquidity',
       dataIndex: 'liquidityUsd',
       key: 'liquidityUsd',
+      sorter: (a: TableData, b: TableData) => {
+        return Number(a.liquidityUsd) - Number(b.liquidityUsd)
+      },
       render: (text: string) => {
         return <span className="text-orange-500 font-bold text-lg" style={{ color: '#00B098'}}>${Number(text).toFixed(2)}</span>
       }