@@ -6,7 +6,7 @@ import { ClipLoader } from 'react-spinners'
6
6
import { CsvDownloadButton } from '~/components/common/CsvDownloader'
7
7
import { Flex } from '~/components/common/Flex'
8
8
import LinkIcon from '~/components/Icons/LinkIcon'
9
- import { getPathway } from '~/network/fetchSourcesData '
9
+ import { getEngagement , getFollowers } from '~/network/tweetAnalyze '
10
10
import { Node } from '~/types'
11
11
import { colors } from '~/utils'
12
12
import { Avatar , Engagement , EngagementBar , SORT_OPTIONS , SortBy , TweetLink , TweetTime , UserInfo , Username } from '..'
@@ -32,9 +32,7 @@ export const EngagementTable = ({ sortBy, idsToAnalyze }: Props) => {
32
32
33
33
try {
34
34
const responses = await Promise . all (
35
- idsToAnalyze . map ( ( id ) =>
36
- getPathway ( id , [ ] , [ 'HAS_REPLY>' , 'HAS_QUOTE>' , 'THREAD_NEXT>' , '<POSTED' ] , sortBy , true , 0 , 10 , 800 ) ,
37
- ) ,
35
+ idsToAnalyze . map ( ( id ) => ( sortBy === 'followers' ? getEngagement ( id ) : getFollowers ( id ) ) ) ,
38
36
)
39
37
40
38
const mainTweetsArray = [ ]
@@ -256,11 +254,12 @@ export const EngagementTable = ({ sortBy, idsToAnalyze }: Props) => {
256
254
< >
257
255
< TableCell >
258
256
{ tweet . properties ?. impression_percentage } %
259
- { tweet . properties ?. impression_count !== undefined && tweet . properties ?. impression_count && (
260
- < Engagement >
261
- < EngagementBar percentage = { Number ( tweet . properties ?. impression_percentage ) } />
262
- </ Engagement >
263
- ) }
257
+ { tweet . properties ?. impression_count !== undefined &&
258
+ Boolean ( tweet . properties ?. impression_count ) && (
259
+ < Engagement >
260
+ < EngagementBar percentage = { Number ( tweet . properties ?. impression_percentage ) } />
261
+ </ Engagement >
262
+ ) }
264
263
</ TableCell >
265
264
< TableCell align = "right" > { Number ( tweet . properties ?. followers ) . toLocaleString ( ) } </ TableCell >
266
265
</ >
0 commit comments