@@ -2,26 +2,32 @@ import React from 'react';
22import { View } from 'react-native' ;
33import Badge from '@components/Badge' ;
44import Icon from '@components/Icon' ;
5+ import useEnvironment from '@hooks/useEnvironment' ;
56import { useMemoizedLazyExpensifyIcons } from '@hooks/useLazyAsset' ;
7+ import useLocalize from '@hooks/useLocalize' ;
68import useTheme from '@hooks/useTheme' ;
79import useThemeStyles from '@hooks/useThemeStyles' ;
810import type { OptionData } from '@libs/ReportUtils' ;
911import CONST from '@src/CONST' ;
1012
11- type OptionRowErrorBadgeProps = {
13+ type ErrorBadgeProps = {
1214 brickRoadIndicator : OptionData [ 'brickRoadIndicator' ] ;
13- actionBadgeText : string ;
15+ actionBadge : OptionData [ 'actionBadge' ] ;
1416} ;
1517
16- function OptionRowErrorBadge ( { brickRoadIndicator, actionBadgeText } : OptionRowErrorBadgeProps ) {
18+ function ErrorBadge ( { brickRoadIndicator, actionBadge } : ErrorBadgeProps ) {
1719 const theme = useTheme ( ) ;
1820 const styles = useThemeStyles ( ) ;
21+ const { translate} = useLocalize ( ) ;
22+ const { isProduction} = useEnvironment ( ) ;
1923 const { DotIndicator} = useMemoizedLazyExpensifyIcons ( [ 'DotIndicator' ] ) ;
2024
2125 if ( brickRoadIndicator !== CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR ) {
2226 return null ;
2327 }
2428
29+ const actionBadgeText = ! isProduction && actionBadge ? translate ( `common.actionBadge.${ actionBadge } ` ) : '' ;
30+
2531 return (
2632 < View style = { [ styles . alignItemsCenter , styles . justifyContentCenter ] } >
2733 { actionBadgeText ? (
@@ -41,6 +47,6 @@ function OptionRowErrorBadge({brickRoadIndicator, actionBadgeText}: OptionRowErr
4147 ) ;
4248}
4349
44- OptionRowErrorBadge . displayName = 'OptionRowErrorBadge ' ;
50+ ErrorBadge . displayName = 'OptionRow.ErrorBadge ' ;
4551
46- export default OptionRowErrorBadge ;
52+ export default ErrorBadge ;
0 commit comments