11import React from 'react' ;
2- import type { OnyxEntry } from 'react-native-onyx' ;
32import useLocalize from '@hooks/useLocalize' ;
43import {
54 getActionableCard3DSTransactionApprovalMessage ,
@@ -9,12 +8,10 @@ import {
98 getMessageOfOldDotReportAction ,
109 getOriginalMessage ,
1110 getRemovedFromApprovalChainMessage ,
12- getReportAction ,
1311 getReportActionText ,
1412 isActionOfType ,
1513 isRejectedAction ,
1614 isUnapprovedAction ,
17- wasActionTakenByCurrentUser ,
1815} from '@libs/ReportActionsUtils' ;
1916import { getDeletedTransactionMessage , getPolicyChangeMessage } from '@libs/ReportUtils' ;
2017import ReportActionItemBasicMessage from '@pages/inbox/report/ReportActionItemBasicMessage' ;
@@ -23,7 +20,6 @@ import type * as OnyxTypes from '@src/types/onyx';
2320
2421type SimpleMessageContentProps = {
2522 action : OnyxTypes . ReportAction ;
26- report : OnyxEntry < OnyxTypes . Report > ;
2723} ;
2824
2925const SIMPLE_MESSAGE_ACTION_TYPES = new Set < string > ( [
@@ -40,7 +36,6 @@ const SIMPLE_MESSAGE_ACTION_TYPES = new Set<string>([
4036 CONST . REPORT . ACTIONS . TYPE . MERGED_WITH_CASH_TRANSACTION ,
4137 CONST . REPORT . ACTIONS . TYPE . DISMISSED_VIOLATION ,
4238 CONST . REPORT . ACTIONS . TYPE . RESOLVED_DUPLICATES ,
43- CONST . REPORT . ACTIONS . TYPE . RECEIPT_SCAN_FAILED ,
4439 CONST . REPORT . ACTIONS . TYPE . DEMOTED_FROM_WORKSPACE ,
4540 CONST . REPORT . ACTIONS . TYPE . ACTIONABLE_CARD_3DS_TRANSACTION_APPROVAL ,
4641 CONST . REPORT . ACTIONS . TYPE . REMOVED_FROM_APPROVAL_CHAIN ,
@@ -51,7 +46,7 @@ function isSimpleMessageAction(action: OnyxTypes.ReportAction): boolean {
5146 return SIMPLE_MESSAGE_ACTION_TYPES . has ( action . actionName ) || isUnapprovedAction ( action ) || isRejectedAction ( action ) ;
5247}
5348
54- function SimpleMessageContent ( { action, report } : SimpleMessageContentProps ) {
49+ function SimpleMessageContent ( { action} : SimpleMessageContentProps ) {
5550 const { translate} = useLocalize ( ) ;
5651
5752 if ( isActionOfType ( action , CONST . REPORT . ACTIONS . TYPE . MARKED_REIMBURSED ) ) {
@@ -93,11 +88,6 @@ function SimpleMessageContent({action, report}: SimpleMessageContentProps) {
9388 if ( isActionOfType ( action , CONST . REPORT . ACTIONS . TYPE . RESOLVED_DUPLICATES ) ) {
9489 return < ReportActionItemBasicMessage message = { translate ( 'violations.resolvedDuplicates' ) } /> ;
9590 }
96- if ( isActionOfType ( action , CONST . REPORT . ACTIONS . TYPE . RECEIPT_SCAN_FAILED ) ) {
97- // RECEIPT_SCAN_FAILED is submitted by Concierge, so use the IOU action to determine edit permission
98- const iouAction = getReportAction ( report ?. parentReportID , report ?. parentReportActionID ) ;
99- return < ReportActionItemBasicMessage message = { translate ( 'violations.smartscanFailed' , { canEdit : wasActionTakenByCurrentUser ( iouAction ) } ) } /> ;
100- }
10191 if ( isUnapprovedAction ( action ) ) {
10292 return < ReportActionItemBasicMessage message = { translate ( 'iou.unapproved' ) } /> ;
10393 }
@@ -120,7 +110,5 @@ function SimpleMessageContent({action, report}: SimpleMessageContentProps) {
120110 return null ;
121111}
122112
123- SimpleMessageContent . displayName = 'SimpleMessageContent' ;
124-
125113export default SimpleMessageContent ;
126114export { isSimpleMessageAction } ;
0 commit comments