@@ -30,7 +30,6 @@ import MoneyRequestReportPreview from '@components/ReportActionItem/MoneyRequest
3030import MovedTransactionAction from '@components/ReportActionItem/MovedTransactionAction' ;
3131import TaskAction from '@components/ReportActionItem/TaskAction' ;
3232import TaskPreview from '@components/ReportActionItem/TaskPreview' ;
33- import TransactionPreview from '@components/ReportActionItem/TransactionPreview' ;
3433import TripRoomPreview from '@components/ReportActionItem/TripRoomPreview' ;
3534import UnreportedTransactionAction from '@components/ReportActionItem/UnreportedTransactionAction' ;
3635import { SearchStateContext } from '@components/Search/SearchContext' ;
@@ -40,7 +39,6 @@ import Text from '@components/Text';
4039import TextLink from '@components/TextLink' ;
4140import UnreadActionIndicator from '@components/UnreadActionIndicator' ;
4241import useConfirmModal from '@hooks/useConfirmModal' ;
43- import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails' ;
4442import { useMemoizedLazyExpensifyIcons } from '@hooks/useLazyAsset' ;
4543import useLocalize from '@hooks/useLocalize' ;
4644import useOnyx from '@hooks/useOnyx' ;
@@ -98,9 +96,7 @@ import {
9896 isReimbursementDeQueuedOrCanceledAction ,
9997 isReimbursementQueuedAction ,
10098 isRenamedAction ,
101- isSplitBillAction as isSplitBillActionReportActionsUtils ,
10299 isTaskAction ,
103- isTrackExpenseAction as isTrackExpenseActionReportActionsUtils ,
104100 isTripPreview ,
105101 isWhisperActionTargetedToOthers ,
106102 useTableReportViewActionRenderConditionals ,
@@ -126,7 +122,7 @@ import variables from '@styles/variables';
126122import { openPersonalBankAccountSetupView } from '@userActions/BankAccounts' ;
127123import type { IgnoreDirection } from '@userActions/ClearReportActionErrors' ;
128124import { hideEmojiPicker , isActive } from '@userActions/EmojiPickerAction' ;
129- import { createTransactionThreadReport , expandURLPreview } from '@userActions/Report' ;
125+ import { expandURLPreview } from '@userActions/Report' ;
130126import CONST from '@src/CONST' ;
131127import ONYXKEYS from '@src/ONYXKEYS' ;
132128import ROUTES from '@src/ROUTES' ;
@@ -137,6 +133,7 @@ import {isEmptyObject, isEmptyValueObject} from '@src/types/utils/EmptyObject';
137133import ApprovalFlowContent , { isApprovalFlowAction } from './actionContents/ApprovalFlowContent' ;
138134import CardBrokenConnectionContent from './actionContents/CardBrokenConnectionContent' ;
139135import ChatMessageContent from './actionContents/ChatMessageContent' ;
136+ import ChatTransactionPreview from './actionContents/ChatTransactionPreview' ;
140137import ConfirmWhisperContent from './actionContents/ConfirmWhisperContent' ;
141138import FraudAlertContent from './actionContents/FraudAlertContent' ;
142139import JoinRequestContent from './actionContents/JoinRequestContent' ;
@@ -165,12 +162,6 @@ type PureReportActionItemProps = {
165162 /** The personal policy ID */
166163 personalPolicyID : string | undefined ;
167164
168- /** Model of onboarding selected */
169- introSelected ?: OnyxEntry < OnyxTypes . IntroSelected > ;
170-
171- /** Beta features list */
172- betas : OnyxEntry < OnyxTypes . Beta [ ] > ;
173-
174165 /** Report for this action */
175166 report : OnyxEntry < OnyxTypes . Report > ;
176167
@@ -337,8 +328,6 @@ const isEmptyHTML = <T extends React.JSX.Element>({props: {html}}: T): boolean =
337328
338329function PureReportActionItem ( {
339330 personalPolicyID,
340- introSelected,
341- betas,
342331 action,
343332 report,
344333 policy,
@@ -393,7 +382,6 @@ function PureReportActionItem({
393382 const { transitionActionSheetState} = ActionSheetAwareScrollView . useActionSheetAwareScrollViewActions ( ) ;
394383 const { translate, formatPhoneNumber, localeCompare, formatTravelDate, datetimeToCalendarTime} = useLocalize ( ) ;
395384 const { showConfirmModal} = useConfirmModal ( ) ;
396- const personalDetail = useCurrentUserPersonalDetails ( ) ;
397385 const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
398386 const reportID = report ?. reportID ?? action ?. reportID ;
399387 const theme = useTheme ( ) ;
@@ -428,8 +416,6 @@ function PureReportActionItem({
428416 [ StyleUtils , isReportActionLinked , theme . messageHighlightBG , shouldHighlight ] ,
429417 ) ;
430418
431- const reportPreviewStyles = StyleUtils . getMoneyRequestReportPreviewStyle ( shouldUseNarrowLayout , 1 , undefined , undefined ) ;
432-
433419 const isDeletedParentAction = isDeletedParentActionUtils ( action ) ;
434420
435421 // IOUDetails only exists when we are sending money
@@ -724,46 +710,16 @@ function PureReportActionItem({
724710 const shouldShowSplitPreview = isSplitBill || isSplitScanWithNoAmount ;
725711 if ( report . chatType === CONST . REPORT . CHAT_TYPE . SELF_DM || shouldShowSplitPreview ) {
726712 children = (
727- < View style = { [ styles . mt1 , styles . w100 ] } >
728- < TransactionPreview
729- iouReportID = { getIOUReportIDFromReportActionPreview ( action ) }
730- chatReportID = { reportID }
731- reportID = { reportID }
732- action = { action }
733- shouldDisplayContextMenu = { shouldDisplayContextMenuValue }
734- isBillSplit = { isSplitBillActionReportActionsUtils ( action ) }
735- transactionID = { shouldShowSplitPreview ? moneyRequestOriginalMessage ?. IOUTransactionID : undefined }
736- containerStyles = { [ reportPreviewStyles . transactionPreviewStandaloneStyle , styles . mt1 ] }
737- transactionPreviewWidth = { reportPreviewStyles . transactionPreviewStandaloneStyle . width }
738- onPreviewPressed = { ( ) => {
739- if ( shouldShowSplitPreview ) {
740- Navigation . navigate ( ROUTES . SPLIT_BILL_DETAILS . getRoute ( chatReportID , action . reportActionID , Navigation . getReportRHPActiveRoute ( ) ) ) ;
741- return ;
742- }
743-
744- // If no childReportID exists, create transaction thread on-demand
745- if ( ! action . childReportID ) {
746- const createdTransactionThreadReport = createTransactionThreadReport (
747- introSelected ,
748- personalDetail . email ?? '' ,
749- personalDetail . accountID ,
750- betas ,
751- iouReport ,
752- action ,
753- ) ;
754- if ( createdTransactionThreadReport ?. reportID ) {
755- Navigation . navigate ( ROUTES . REPORT_WITH_ID . getRoute ( createdTransactionThreadReport . reportID , undefined , undefined , Navigation . getActiveRoute ( ) ) ) ;
756- return ;
757- }
758- return ;
759- }
760-
761- Navigation . navigate ( ROUTES . REPORT_WITH_ID . getRoute ( action . childReportID , undefined , undefined , Navigation . getActiveRoute ( ) ) ) ;
762- } }
763- isTrackExpense = { isTrackExpenseActionReportActionsUtils ( action ) }
764- originalReportID = { originalReportID }
765- />
766- </ View >
713+ < ChatTransactionPreview
714+ action = { action }
715+ reportID = { reportID }
716+ originalReportID = { originalReportID }
717+ chatReportID = { chatReportID }
718+ iouReport = { iouReport }
719+ shouldShowSplitPreview = { shouldShowSplitPreview }
720+ shouldDisplayContextMenu = { shouldDisplayContextMenuValue }
721+ transactionID = { shouldShowSplitPreview ? moneyRequestOriginalMessage ?. IOUTransactionID : undefined }
722+ />
767723 ) ;
768724 } else {
769725 children = emptyHTML ;
@@ -1089,7 +1045,6 @@ function PureReportActionItem({
10891045 contextMenuStateValue = { contextMenuStateValue }
10901046 contextMenuActionsValue = { contextMenuActionsValue }
10911047 userBillingFundID = { userBillingFundID }
1092- introSelected = { introSelected }
10931048 />
10941049 ) ;
10951050 }
@@ -1436,8 +1391,6 @@ export default memo(PureReportActionItem, (prevProps, nextProps) => {
14361391 prevProps . isUserValidated === nextProps . isUserValidated &&
14371392 prevProps . parentReport ?. reportID === nextProps . parentReport ?. reportID &&
14381393 deepEqual ( prevProps . personalDetails , nextProps . personalDetails ) &&
1439- deepEqual ( prevProps . introSelected , nextProps . introSelected ) &&
1440- deepEqual ( prevProps . betas , nextProps . betas ) &&
14411394 prevProps . originalReportID === nextProps . originalReportID &&
14421395 deepEqual ( prevProps . originalReport ?. participants , nextProps . originalReport ?. participants ) &&
14431396 prevProps . isArchivedRoom === nextProps . isArchivedRoom &&
0 commit comments