complete award page - score - transactions not complete

This commit is contained in:
Alihaghighattalab
2024-08-17 11:14:21 +03:30
parent 2a54970b12
commit 49cd5faf9d
10 changed files with 101 additions and 45 deletions
+13 -7
View File
@@ -1,18 +1,24 @@
import { useState } from "react"
import { useEffect, useState } from "react"
import { Table } from "../common/table"
import { SortingState } from "@tanstack/react-table"
import { scoresCol } from "../../utility/score"
import { useQuery } from "@tanstack/react-query"
import { getScoresList } from "../../services/api/score"
export const Score = () => {
const [sorting, setSorting] = useState<SortingState>([])
// const { data, isLoading } = useQuery({
// queryKey: ["score-list"],
// queryFn: getScoreList
// })
const { data, isLoading } = useQuery({
queryKey: ["score-list"],
queryFn: getScoresList
})
// if (isLoading) return <p>LOADING ...</p>
useEffect(() => {
console.log("data =>", data)
}, [data])
if (isLoading) return <p>LOADING ...</p>
return (
<Table sorting={sorting} setSorting={setSorting} columns={scoresCol} data={[]} tableStatus={true} />
<Table sorting={sorting} setSorting={setSorting} columns={scoresCol} data={data?.data} tableStatus={data?.score} />
)
}