1
1
import { Fragment , memo , ReactNode , useCallback , useMemo , useRef , useState } from 'react' ;
2
2
import { formatDate , formatISO , parse as parseDate } from 'date-fns' ;
3
3
import { formatInTimeZone , toZonedTime } from 'date-fns-tz' ;
4
- import { ArrowDown , ArrowUp , ArrowUpDown , Clock , ExternalLinkIcon , XIcon } from 'lucide-react' ;
4
+ import {
5
+ ArrowDown ,
6
+ ArrowUp ,
7
+ ArrowUpDown ,
8
+ Clock ,
9
+ ExternalLinkIcon ,
10
+ LoaderCircleIcon ,
11
+ XIcon ,
12
+ } from 'lucide-react' ;
5
13
import { Bar , BarChart , ReferenceArea , XAxis } from 'recharts' ;
6
14
import { useClient , useQuery } from 'urql' ;
7
15
import { z } from 'zod' ;
@@ -660,7 +668,13 @@ const TracesList = memo(function TracesList(
660
668
} }
661
669
disabled = { props . isFetchingMore || ! props . fetchMore }
662
670
>
663
- Load more
671
+ { props . isFetchingMore ? (
672
+ < >
673
+ < LoaderCircleIcon className = "mr-2 inline size-4 animate-spin" /> Loading
674
+ </ >
675
+ ) : (
676
+ 'Load more'
677
+ ) }
664
678
</ Button >
665
679
</ div >
666
680
</ div >
@@ -1148,7 +1162,7 @@ function TargetTracesPageContent(props: SortProps & PaginationProps & FilterProp
1148
1162
} ,
1149
1163
} ) ;
1150
1164
1151
- const [ isFetchMore , setIsFetchingMore ] = useState ( false ) ;
1165
+ const [ isFetchingMore , setIsFetchingMore ] = useState ( false ) ;
1152
1166
1153
1167
const traces = useMemo (
1154
1168
( ) => query . data ?. target ?. traces . edges . map ( e => e . node ) ,
@@ -1272,7 +1286,7 @@ function TargetTracesPageContent(props: SortProps & PaginationProps & FilterProp
1272
1286
selectedTraceId = { selectedTraceId }
1273
1287
isFetching = { query . fetching }
1274
1288
filter = { filter }
1275
- isFetchingMore = { isFetchMore }
1289
+ isFetchingMore = { isFetchingMore }
1276
1290
fetchMore = {
1277
1291
query . data ?. target ?. traces . pageInfo . hasNextPage
1278
1292
? ( ) => {
@@ -1284,7 +1298,7 @@ function TargetTracesPageContent(props: SortProps & PaginationProps & FilterProp
1284
1298
}
1285
1299
setIsFetchingMore ( true ) ;
1286
1300
1287
- urql
1301
+ void urql
1288
1302
. query ( TargetTracesFetchMoreTracesQuery , {
1289
1303
targetRef : {
1290
1304
organizationSlug : targetRef . organizationSlug ,
0 commit comments