@@ -14,18 +14,14 @@ import {useMemoizedLazyExpensifyIcons, useMemoizedLazyIllustrations} from '@hook
1414import useLocalize from '@hooks/useLocalize' ;
1515import useTheme from '@hooks/useTheme' ;
1616import useThemeStyles from '@hooks/useThemeStyles' ;
17- import type { GustoSyncResult , GustoSyncResultUser } from '@libs/API/GustoSyncResult' ;
17+ import type { GustoSyncResult } from '@libs/API/GustoSyncResult' ;
1818import CONST from '@src/CONST' ;
1919
2020type GustoSyncResultsModalProps = ModalProps & {
2121 /** Sync result returned by the completed Gusto sync job */
2222 result : GustoSyncResult ;
2323} ;
2424
25- function getResultCount ( users ?: GustoSyncResultUser [ ] ) {
26- return users ?. length ?? 0 ;
27- }
28-
2925function GustoSyncResultsModal ( { result, closeModal} : GustoSyncResultsModalProps ) {
3026 const { translate} = useLocalize ( ) ;
3127 const styles = useThemeStyles ( ) ;
@@ -34,9 +30,9 @@ function GustoSyncResultsModal({result, closeModal}: GustoSyncResultsModalProps)
3430 const illustrations = useMemoizedLazyIllustrations ( [ 'NewUser' ] ) ;
3531 const [ isSkippedSectionExpanded , setIsSkippedSectionExpanded ] = useState ( false ) ;
3632
37- const addedCount = getResultCount ( result . added ) ;
38- const removedCount = getResultCount ( result . removed ) ;
39- const skippedCount = getResultCount ( result . skipped ) ;
33+ const addedCount = result . addedEmployeesCount ?? 0 ;
34+ const removedCount = result . removedEmployeesCount ?? 0 ;
35+ const skippedCount = result . skippedEmployees ?. length ?? 0 ;
4036 const closeResultsModal = ( ) => closeModal ( ) ;
4137
4238 const renderResultSummary = ( label : string , count : number ) => (
@@ -99,13 +95,13 @@ function GustoSyncResultsModal({result, closeModal}: GustoSyncResultsModalProps)
9995 />
10096 </ PressableWithoutFeedback >
10197 { isSkippedSectionExpanded &&
102- result . skipped ?. map ( ( user ) => (
98+ result . skippedEmployees ?. map ( ( employee ) => (
10399 < View
104- key = { user . email }
100+ key = { employee . id }
105101 style = { [ styles . mt4 ] }
106102 >
107- < Text style = { [ styles . textNormalThemeText , styles . textStrong ] } > { user . displayName ?? user . email } </ Text >
108- < Text style = { [ styles . textSupporting ] } > { user . reason } </ Text >
103+ < Text style = { [ styles . textNormalThemeText , styles . textStrong ] } > { employee . name } </ Text >
104+ < Text style = { [ styles . textSupporting ] } > { employee . reason } </ Text >
109105 </ View >
110106 ) ) }
111107 </ ScrollView >
0 commit comments