@@ -102,7 +102,9 @@ interface ProcessedData {
102102}
103103
104104const formatNumber = ( value : number | null | undefined ) : string => {
105- if ( value == null || Number . isNaN ( value ) ) return '0' ;
105+ if ( value == null || Number . isNaN ( value ) ) {
106+ return '0' ;
107+ }
106108 return Intl . NumberFormat ( undefined , {
107109 notation : 'compact' ,
108110 maximumFractionDigits : 1 ,
@@ -141,8 +143,8 @@ const getConnectionIcon = (connection: string): React.ReactNode => {
141143 return < Globe className = "h-4 w-4 text-primary" /> ;
142144} ;
143145
144- const normalizeData = ( data : string [ ] ) : GeographicEntry [ ] =>
145- data ?. map ( ( item ) => ( {
146+ const normalizeData = ( data : any [ ] ) : GeographicEntry [ ] =>
147+ data ?. map ( ( item : any ) => ( {
146148 name : item . country_name || item . name || 'Unknown' ,
147149 visitors : item . visitors || 0 ,
148150 pageviews : item . pageviews || 0 ,
@@ -191,7 +193,9 @@ export function WebsiteAudienceTab({
191193 } = useBatchDynamicQuery ( websiteId , dateRange , batchQueries ) ;
192194
193195 const handleRefresh = useCallback ( async ( ) => {
194- if ( ! isRefreshing ) return ;
196+ if ( ! isRefreshing ) {
197+ return ;
198+ }
195199
196200 try {
197201 await refetchBatch ( ) ;
@@ -344,10 +348,12 @@ export function WebsiteAudienceTab({
344348
345349 const processedConnectionData = useMemo ( ( ) : ConnectionEntry [ ] => {
346350 const connectionData = processedData . device . connection_type ;
347- if ( ! connectionData ?. length ) return [ ] ;
351+ if ( ! connectionData ?. length ) {
352+ return [ ] ;
353+ }
348354
349355 const totalVisitors = connectionData . reduce (
350- ( sum : number , item : string ) => sum + item . visitors ,
356+ ( sum : number , item : any ) => sum + item . visitors ,
351357 0
352358 ) ;
353359
@@ -642,7 +648,9 @@ export function WebsiteAudienceTab({
642648
643649 // Feature detection for Intl.DisplayNames
644650 const canUseDisplayNames = useMemo ( ( ) => {
645- if ( typeof window === 'undefined' ) return false ;
651+ if ( typeof window === 'undefined' ) {
652+ return false ;
653+ }
646654 try {
647655 // Try to construct and use .of
648656 const dn = new Intl . DisplayNames ( [ navigator . language || 'en' ] , {
@@ -977,7 +985,9 @@ export function WebsiteAudienceTab({
977985 ?. slice ( 0 , 6 )
978986 . map ( ( item : ScreenResolutionEntry ) => {
979987 const resolution = item . name ;
980- if ( ! resolution ) return null ;
988+ if ( ! resolution ) {
989+ return null ;
990+ }
981991 const [ width , height ] = resolution . split ( 'x' ) . map ( Number ) ;
982992 const isValid = ! (
983993 Number . isNaN ( width ) || Number . isNaN ( height )
0 commit comments