= ( {
/>
{ /* Dispute Actions */ }
- { showDisputeStepsAndActions && (
+ {
= ( {
'Continue with challenge',
'woocommerce-payments'
)
- : __(
- 'Challenge dispute',
- 'woocommerce-payments'
- ) }
+ : challengeButtonDefaultText }
@@ -138,8 +266,7 @@ const DisputeAwaitingResponseDetails: React.FC< Props > = ( {
disabled={ isLoading }
onClick={ () => {
wcpayTracks.recordEvent(
- wcpayTracks.events
- .DISPUTE_ACCEPT_MODAL_VIEW,
+ disputeAcceptAction.acceptButtonTracksEvent,
{
dispute_status: dispute.status,
}
@@ -147,15 +274,13 @@ const DisputeAwaitingResponseDetails: React.FC< Props > = ( {
setModalOpen( true );
} }
>
- { __(
- 'Accept dispute',
- 'woocommerce-payments'
- ) }
+ { disputeAcceptAction.acceptButtonLabel }
+ { /** Accept dispute modal */ }
{ isModalOpen && (
@@ -167,40 +292,19 @@ const DisputeAwaitingResponseDetails: React.FC< Props > = ( {
) }
-
-
-
-
-
- { createInterpolateElement(
- sprintf(
- /* translators: %s: dispute fee, : emphasis HTML element. */
- __(
- 'Accepting the dispute marks it as Lost. The disputed amount will be returned to the cardholder, with a %s dispute fee deducted from your account.',
- 'woocommerce-payments'
- ),
- getDisputeFeeFormatted(
- dispute,
- true
- ) ?? '-'
- ),
- {
- em: ,
- }
- ) }
-
-
-
-
-
-
-
- { __(
- 'Accepting the dispute is final and cannot be undone.',
- 'woocommerce-payments'
- ) }
-
-
+
+ { disputeAcceptAction.modalLines.map(
+ ( line, key ) => (
+
+
+ { line.icon }
+
+
+ { line.description }
+
+
+ )
+ ) }
= ( {
variant="primary"
onClick={ () => {
wcpayTracks.recordEvent(
- wcpayTracks.events
- .DISPUTE_ACCEPT_CLICK,
+ disputeAcceptAction.modalButtonTracksEvent,
{
dispute_status:
dispute.status,
}
);
setModalOpen( false );
- doAccept();
+ /**
+ * Handle the primary modal action.
+ * If it's an inquiry, redirect to the order page; otherwise, continue with the default dispute acceptance.
+ */
+ if ( isInquiry( dispute ) ) {
+ viewOrder();
+ } else {
+ doAccept();
+ }
} }
>
- { __(
- 'Accept dispute',
- 'woocommerce-payments'
- ) }
+ {
+ disputeAcceptAction.modalButtonLabel
+ }
) }
- ) }
+ }