11import { DETAIL_TABLE_LENGTH , TABLE_REFETCH_INTERVAL } from '@/config' ;
22import { execute } from '@/graphql/execute' ;
33import { keepPreviousData , useQuery } from '@tanstack/react-query' ;
4- import { Terminal } from 'lucide-react' ;
54import { DataTable } from '@/components/DataTable' ;
6- import { Alert , AlertDescription , AlertTitle } from '@/components/ui/alert ' ;
5+ import { ErrorAlert } from '@/modules/ErrorAlert ' ;
76import useUserStore from '@/stores/useUser.store' ;
87import { columns } from './dealTaskColumns' ;
98import { dealTasksQuery } from './dealTasksQuery' ;
@@ -15,7 +14,10 @@ function useDealTasksData({ dealAddress }: { dealAddress: string }) {
1514 {
1615 queryKey : [ 'deal' , 'tasks' , dealAddress ] ,
1716 queryFn : ( ) =>
18- execute ( dealTasksQuery , chainId , { length : DETAIL_TABLE_LENGTH , dealAddress } ) ,
17+ execute ( dealTasksQuery , chainId , {
18+ length : DETAIL_TABLE_LENGTH ,
19+ dealAddress,
20+ } ) ,
1921 refetchInterval : TABLE_REFETCH_INTERVAL ,
2022 placeholderData : keepPreviousData ,
2123 }
@@ -42,13 +44,7 @@ export function DealTasksTable({ dealAddress }: { dealAddress: string }) {
4244 // TODO: handle loading state
4345
4446 return hasPastError && ! tasks . length ? (
45- < Alert variant = "destructive" className = "mx-auto w-fit text-left" >
46- < Terminal className = "h-4 w-4" />
47- < AlertTitle > Error</ AlertTitle >
48- < AlertDescription >
49- An error occurred during deal tasks loading.
50- </ AlertDescription >
51- </ Alert >
47+ < ErrorAlert message = "An error occurred during deal tasks loading." />
5248 ) : (
5349 < DataTable columns = { columns } data = { tasks } />
5450 ) ;
0 commit comments