import { AddressSummary } from '@components/common/customer/address/AddressSummary.js'; import { Card, CardContent, CardHeader, CardTitle } from '@components/common/ui/Card.js'; import { _ } from '@evershop/evershop/lib/locale/translate/_'; import React from 'react'; interface CustomerProps { order: { customerFullName: string; customerEmail: string; customerUrl?: 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 Customer({ order: { noShippingRequired, shippingAddress, billingAddress, customerFullName, customerEmail, customerUrl } }: CustomerProps) { return ( {_('Customer Information')} {customerUrl && ( {customerFullName} )} {!customerUrl && ( {customerEmail} {_('(Guest Checkout)')} )} {_('Contact Information')}
{customerEmail}
{shippingAddress?.telephone && (
{shippingAddress.telephone}
)}
{_('Shipping Address')} {!noShippingRequired && } {noShippingRequired && ( {_('No shipping required')} )} {_('Billing address')} {billingAddress ? ( ) : ( {_('Not collected (zero-total order)')} )}
); } export const layout = { areaId: 'rightSide', sortOrder: 15 }; export const query = ` query Query { order(uuid: getContextValue("orderId")) { customerFullName customerEmail customerUrl noShippingRequired shippingAddress { recipient telephone formatted } billingAddress { recipient telephone formatted } } } `;