complete transactions page
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { useState } from "react"
|
||||
import { Table } from "../common/table"
|
||||
import { SortingState } from "@tanstack/react-table"
|
||||
import { transactionsCol } from "../../utility/transactions"
|
||||
import { useQuery } from "@tanstack/react-query"
|
||||
import { getTransactionsList } from "../../services/api/transactions"
|
||||
|
||||
export const Transactions = () => {
|
||||
const [sorting, setSorting] = useState<SortingState>([])
|
||||
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: ["transactions-list"],
|
||||
queryFn: getTransactionsList
|
||||
})
|
||||
|
||||
if (isLoading) return <p>LOADING ....</p>
|
||||
return (
|
||||
<Table sorting={sorting} setSorting={setSorting} columns={transactionsCol} data={data?.data} />
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user