File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
app/[team]/[project]/(project)/deployments/[[...slug]]/_components Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import {
25
25
TableHeader ,
26
26
TableRow ,
27
27
} from "@/components/ui/table" ;
28
- import { objectToTableData } from "@/lib/utils" ;
29
28
30
29
interface DataTableProps < TData , TValue > {
31
30
columns : Array < ColumnDef < TData , TValue > > ;
@@ -40,7 +39,7 @@ export function DataTable<TData, TValue>({
40
39
React . useState < VisibilityState > ( { } ) ;
41
40
42
41
const table = useReactTable ( {
43
- data : objectToTableData < TData > ( data ) ,
42
+ data,
44
43
columns,
45
44
getCoreRowModel : getCoreRowModel ( ) ,
46
45
getPaginationRowModel : getPaginationRowModel ( ) ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import HashDisplay from "./hash-display";
18
18
import { blockExplorers } from "@/lib/block-explorers" ;
19
19
import { openSeaLinks } from "@/lib/open-sea" ;
20
20
import { chainsMap } from "@/lib/chains-map" ;
21
+ import { objectToTableData } from "@/lib/utils" ;
21
22
22
23
const timeAgo = new TimeAgo ( "en-US" ) ;
23
24
@@ -63,6 +64,7 @@ export default async function TablelandTable({
63
64
64
65
const tbl = new Database ( { baseUrl : helpers . getBaseUrl ( chainId ) } ) ;
65
66
const data = await tbl . prepare ( `SELECT * FROM ${ tableName } ;` ) . all ( ) ;
67
+ const formattedData = objectToTableData ( data . results ) ;
66
68
const columns : Array < ColumnDef < unknown > > = data . results . length
67
69
? Object . keys ( data . results [ 0 ] as object ) . map ( ( col ) => ( {
68
70
accessorKey : col ,
@@ -176,7 +178,7 @@ export default async function TablelandTable({
176
178
< TabsTrigger value = "logs" > SQL Logs</ TabsTrigger >
177
179
</ TabsList >
178
180
< TabsContent value = "data" >
179
- < DataTable columns = { columns } data = { data . results } />
181
+ < DataTable columns = { columns } data = { formattedData } />
180
182
</ TabsContent >
181
183
< TabsContent value = "logs" >
182
184
< SQLLogs chain = { chainId } tableId = { tokenId } />
You can’t perform that action at this time.
0 commit comments