import React, { Component } from "react"; import { Box, Typography, Button } from "@mui/material"; import { withI18n } from "../../i18n/withTranslation.js"; class PaymentConfirmationDialog extends Component { render() { const { paymentCompletionData, isCompletingOrder, completionError, orderCompleted, onContinueShopping, onViewOrders, } = this.props; if (!paymentCompletionData) return null; return ( {paymentCompletionData.isSuccessful ? (this.props.t ? this.props.t('payment.successful') : 'Zahlung erfolgreich!') : (this.props.t ? this.props.t('payment.failed') : 'Zahlung fehlgeschlagen')} {paymentCompletionData.isSuccessful ? ( <> {orderCompleted ? ( {this.props.t ? this.props.t('payment.orderCompleted') : '🎉 Ihre Bestellung wurde erfolgreich abgeschlossen! Sie können jetzt Ihre Bestellungen einsehen.'} ) : ( {this.props.t ? this.props.t('payment.orderProcessing') : 'Ihre Zahlung wurde erfolgreich verarbeitet. Die Bestellung wird automatisch abgeschlossen.'} )} ) : ( {this.props.t ? this.props.t('payment.paymentError') : 'Ihre Zahlung konnte nicht verarbeitet werden. Bitte versuchen Sie es erneut oder wählen Sie eine andere Zahlungsmethode.'} )} {isCompletingOrder && ( {this.props.t ? this.props.t('orders.processing') : 'Bestellung wird abgeschlossen...'} )} {completionError && ( {completionError} )} {orderCompleted && ( )} ); } } export default withI18n()(PaymentConfirmationDialog);