diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index fdf6f8edd825..e95ab550c29f 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -89,6 +89,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea const {reimbursableSpend} = ReportUtils.getMoneyRequestSpendBreakdown(moneyRequestReport); const isOnHold = TransactionUtils.isOnHold(transaction); const isDeletedParentAction = !!requestParentReportAction && ReportActionsUtils.isDeletedAction(requestParentReportAction); + const isDuplicate = TransactionUtils.isDuplicate(transaction?.transactionID ?? ''); // Only the requestor can delete the request, admins can only edit it. const isActionOwner = @@ -247,6 +248,11 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea [chatReport?.isOwnPolicyExpenseChat, policy?.harvesting?.enabled], ); + const shouldDuplicateButtonBeSuccess = useMemo( + () => isDuplicate && !shouldShowSettlementButton && !shouldShowExportIntegrationButton && !shouldShowSubmitButton && !hasAllPendingRTERViolations, + [isDuplicate, shouldShowSettlementButton, shouldShowExportIntegrationButton, shouldShowSubmitButton, hasAllPendingRTERViolations], + ); + useEffect(() => { if (isLoadingHoldUseExplained) { return; @@ -294,6 +300,18 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea // Shows border if no buttons or banners are showing below the header shouldShowBorderBottom={!isMoreContentShown} > + {isDuplicate && !shouldUseNarrowLayout && ( + +