@propeller-commerce/propeller-v2-react-ui 0.4.24 → 0.4.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pure.d.cts CHANGED
@@ -315,6 +315,19 @@ interface OrderSummaryProps {
315
315
  formatDate?: (dateString: string) => string;
316
316
  /** Labels for the component */
317
317
  labels?: Record<string, string>;
318
+ /**
319
+ * Localized order/quote status labels, keyed by the raw backend status
320
+ * (e.g. `{ NEW: 'Nieuw', REQUEST: 'Aangevraagd' }`). Unknown → raw value.
321
+ */
322
+ statusLabels?: Record<string, string>;
323
+ /**
324
+ * Localized payment-method names, keyed by the raw method value LOWER-CASED
325
+ * (e.g. `{ rekening: 'Op rekening', account: 'Op rekening' }`). The backend
326
+ * sends different raw values on the order vs quote path (REKENING / ACCOUNT),
327
+ * so mapping both here makes the same method render identically. Unknown →
328
+ * raw value.
329
+ */
330
+ paymethodLabels?: Record<string, string>;
318
331
  /** List of countries for resolving codes to names [{code: 'NL', name: 'Netherlands'}, ...] */
319
332
  countries?: {
320
333
  code: string;
package/dist/pure.d.ts CHANGED
@@ -315,6 +315,19 @@ interface OrderSummaryProps {
315
315
  formatDate?: (dateString: string) => string;
316
316
  /** Labels for the component */
317
317
  labels?: Record<string, string>;
318
+ /**
319
+ * Localized order/quote status labels, keyed by the raw backend status
320
+ * (e.g. `{ NEW: 'Nieuw', REQUEST: 'Aangevraagd' }`). Unknown → raw value.
321
+ */
322
+ statusLabels?: Record<string, string>;
323
+ /**
324
+ * Localized payment-method names, keyed by the raw method value LOWER-CASED
325
+ * (e.g. `{ rekening: 'Op rekening', account: 'Op rekening' }`). The backend
326
+ * sends different raw values on the order vs quote path (REKENING / ACCOUNT),
327
+ * so mapping both here makes the same method render identically. Unknown →
328
+ * raw value.
329
+ */
330
+ paymethodLabels?: Record<string, string>;
318
331
  /** List of countries for resolving codes to names [{code: 'NL', name: 'Netherlands'}, ...] */
319
332
  countries?: {
320
333
  code: string;
package/dist/pure.js CHANGED
@@ -411,11 +411,13 @@ function OrderSummary(props) {
411
411
  const showRemarks = props.showRemarks !== void 0 ? props.showRemarks : true;
412
412
  const orderNumber = order?.id || "";
413
413
  const orderDate = order?.createdAt || "";
414
- const orderStatus = order?.status || "";
414
+ const rawStatus = order?.status || "";
415
+ const orderStatus = rawStatus ? props.statusLabels?.[rawStatus] || rawStatus : "";
415
416
  const orderTotal = Number(order?.total?.net || 0);
416
417
  const orderReference = order?.reference || "";
417
418
  const orderRemarks = order?.remarks || "";
418
- const paymentMethod = order?.paymentData?.method || "";
419
+ const rawPaymentMethod = order?.paymentData?.method || "";
420
+ const paymentMethod = rawPaymentMethod ? props.paymethodLabels?.[rawPaymentMethod.toLowerCase()] || rawPaymentMethod : "";
419
421
  const carrierName = order?.postageData?.carrier || "";
420
422
  const addresses = order?.addresses || [];
421
423
  const invoiceAddress = addresses.find((a) => a.type === "invoice") || null;