@@ -2,6 +2,7 @@ import React, {useMemo} from 'react';
22import { View } from 'react-native' ;
33import type { ValueOf } from 'type-fest' ;
44import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails' ;
5+ import { useMemoizedLazyExpensifyIcons } from '@hooks/useLazyAsset' ;
56import useTheme from '@hooks/useTheme' ;
67import useThemeStyles from '@hooks/useThemeStyles' ;
78import { parseMessage } from '@libs/NextStepUtils' ;
@@ -10,7 +11,6 @@ import CONST from '@src/CONST';
1011import type ReportNextStepDeprecated from '@src/types/onyx/ReportNextStepDeprecated' ;
1112import type IconAsset from '@src/types/utils/IconAsset' ;
1213import Icon from './Icon' ;
13- import * as Expensicons from './Icon/Expensicons' ;
1414import RenderHTML from './RenderHTML' ;
1515
1616type MoneyReportHeaderStatusBarProps = {
@@ -20,15 +20,19 @@ type MoneyReportHeaderStatusBarProps = {
2020
2121type IconName = ValueOf < typeof CONST . NEXT_STEP . ICONS > ;
2222type IconMap = Record < IconName , IconAsset > ;
23- const iconMap : IconMap = {
24- [ CONST . NEXT_STEP . ICONS . HOURGLASS ] : Expensicons . Hourglass ,
25- [ CONST . NEXT_STEP . ICONS . CHECKMARK ] : Expensicons . Checkmark ,
26- [ CONST . NEXT_STEP . ICONS . STOPWATCH ] : Expensicons . Stopwatch ,
27- } ;
2823
2924function MoneyReportHeaderStatusBar ( { nextStep} : MoneyReportHeaderStatusBarProps ) {
3025 const styles = useThemeStyles ( ) ;
3126 const theme = useTheme ( ) ;
27+ const icons = useMemoizedLazyExpensifyIcons ( [ 'Hourglass' , 'Checkmark' , 'Stopwatch' ] as const ) ;
28+ const iconMap : IconMap = useMemo (
29+ ( ) => ( {
30+ [ CONST . NEXT_STEP . ICONS . HOURGLASS ] : icons . Hourglass ,
31+ [ CONST . NEXT_STEP . ICONS . CHECKMARK ] : icons . Checkmark ,
32+ [ CONST . NEXT_STEP . ICONS . STOPWATCH ] : icons . Stopwatch ,
33+ } ) ,
34+ [ icons ] ,
35+ ) ;
3236 const currentUserPersonalDetails = useCurrentUserPersonalDetails ( ) ;
3337 const currentUserEmail = currentUserPersonalDetails . login ?? '' ;
3438 const messageContent = useMemo ( ( ) => {
@@ -40,7 +44,7 @@ function MoneyReportHeaderStatusBar({nextStep}: MoneyReportHeaderStatusBarProps)
4044 < View style = { [ styles . dFlex , styles . flexRow , styles . alignItemsCenter , styles . overflowHidden , styles . w100 , styles . headerStatusBarContainer ] } >
4145 < View style = { [ styles . mr3 ] } >
4246 < Icon
43- src = { ( nextStep ?. icon && iconMap ?. [ nextStep . icon ] ) ?? Expensicons . Hourglass }
47+ src = { ( nextStep ?. icon && iconMap ?. [ nextStep . icon ] ) ?? icons . Hourglass }
4448 height = { variables . iconSizeSmall }
4549 width = { variables . iconSizeSmall }
4650 fill = { theme . icon }
0 commit comments