import { AddressSummary } from '@components/common/customer/address/AddressSummary.js'; import { _ } from '@evershop/evershop/lib/locale/translate/_'; import { Check } from 'lucide-react'; import React from 'react'; interface CustomerInfoProps { order: { orderNumber: string; customerFullName: string; customerEmail: string; paymentMethodName: string; noShippingRequired: boolean; shippingAddress: { recipient: string; telephone: string; /** Display lines for the address's country (spec § 3.6). */ formatted: string[]; }; billingAddress: { recipient: string; telephone: string; formatted: string[]; } | null; // zero-total orders don't collect a billing address }; } export default function CustomerInfo({ order: { orderNumber, customerFullName, customerEmail, paymentMethodName, noShippingRequired, shippingAddress, billingAddress } }: CustomerInfoProps) { // One key for the whole sentence: the order number sits mid-clause, so a translator // must be able to move it (and localize the "#" prefix — № in ru, Nr. in de, n° in fr). // `_()` leaves ${orderNumber} untouched (absent from the values), so we split on it to // keep the number in its own emphasized . const confirmation = _( 'Order #${orderNumber} is confirmed. We’ve emailed a receipt to ${email}.', { email: customerEmail } ); const [confirmBefore, confirmAfter = ''] = confirmation.split('${orderNumber}'); return (

{_('Thank you for your order!')}

{confirmBefore} {orderNumber} {confirmAfter}

{_('Contact information')}

{customerFullName || billingAddress?.recipient}
{customerEmail}

{_('Shipping Address')}

{noShippingRequired ? ( _('No shipping required') ) : ( )}

{_('Payment Method')}

{paymentMethodName}
{billingAddress && (

{_('Billing Address')}

)}
); } export const layout = { areaId: 'checkoutSuccessPageLeft', sortOrder: 10 }; export const query = ` query Query { order (uuid: getContextValue('orderId')) { orderNumber customerFullName customerEmail paymentMethodName noShippingRequired shippingNote shippingAddress { recipient telephone formatted } billingAddress { recipient telephone formatted } } } `;