@fluid-app/portal-sdk 0.1.35 → 0.1.37

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.
Files changed (81) hide show
  1. package/dist/{ContactsScreen-eDQWCAQK.mjs → ContactsScreen-C9kEFGyO.mjs} +4 -4
  2. package/dist/{ContactsScreen-eDQWCAQK.mjs.map → ContactsScreen-C9kEFGyO.mjs.map} +1 -1
  3. package/dist/{ContactsScreen-BZSNw0uV.cjs → ContactsScreen-CSRNNY-u.cjs} +4 -4
  4. package/dist/{ContactsScreen-BZSNw0uV.cjs.map → ContactsScreen-CSRNNY-u.cjs.map} +1 -1
  5. package/dist/{ContactsScreen-XI4f7ix6.cjs → ContactsScreen-CYYOSb1o.cjs} +3 -3
  6. package/dist/{FluidProvider-BXxRdatZ.cjs → FluidProvider-D2VHDQOl.cjs} +23 -1
  7. package/dist/{FluidProvider-BXxRdatZ.cjs.map → FluidProvider-D2VHDQOl.cjs.map} +1 -1
  8. package/dist/{FluidProvider-CWC6LA9W.mjs → FluidProvider-S05cIFwO.mjs} +23 -1
  9. package/dist/FluidProvider-S05cIFwO.mjs.map +1 -0
  10. package/dist/{MessagingScreen-Df6yRSZ5.mjs → MessagingScreen-B5FFX0rk.mjs} +4 -4
  11. package/dist/{MessagingScreen-Df6yRSZ5.mjs.map → MessagingScreen-B5FFX0rk.mjs.map} +1 -1
  12. package/dist/{MessagingScreen-onjDz5S1.cjs → MessagingScreen-BVoTHaZo.cjs} +4 -4
  13. package/dist/{MessagingScreen-onjDz5S1.cjs.map → MessagingScreen-BVoTHaZo.cjs.map} +1 -1
  14. package/dist/{MessagingScreen-Dp3t7kpp.cjs → MessagingScreen-CbtZhxMa.cjs} +2 -2
  15. package/dist/{MessagingScreen-CXA3RIlu2.mjs → MessagingScreen-oclISkI22.mjs} +2 -2
  16. package/dist/{OrdersScreen-DTF-zAqR.mjs → OrdersScreen-C3U5o8Ix.mjs} +4 -4
  17. package/dist/{OrdersScreen-DTF-zAqR.mjs.map → OrdersScreen-C3U5o8Ix.mjs.map} +1 -1
  18. package/dist/{OrdersScreen-BeUKNA_f.cjs → OrdersScreen-CGUvJ3rO.cjs} +4 -4
  19. package/dist/{OrdersScreen-BeUKNA_f.cjs.map → OrdersScreen-CGUvJ3rO.cjs.map} +1 -1
  20. package/dist/{OrdersScreen-DJFlTTTO.cjs → OrdersScreen-D5ljtaRm.cjs} +3 -3
  21. package/dist/{ProductsScreen-CtGow3-U.mjs → ProductsScreen-BfPljupU.mjs} +4 -4
  22. package/dist/{ProductsScreen-CtGow3-U.mjs.map → ProductsScreen-BfPljupU.mjs.map} +1 -1
  23. package/dist/{ProductsScreen-UgEr2Y6M.cjs → ProductsScreen-CCrZS-7j.cjs} +3 -3
  24. package/dist/{ProductsScreen-CzbRJMF4.cjs → ProductsScreen-D3ySzLOk.cjs} +4 -4
  25. package/dist/{ProductsScreen-CzbRJMF4.cjs.map → ProductsScreen-D3ySzLOk.cjs.map} +1 -1
  26. package/dist/{ProductsScreen-CNz_p26B.mjs → ProductsScreen-DSmPPJfw.mjs} +3 -3
  27. package/dist/{ProfileScreen-DCFj7ETG.mjs → ProfileScreen-BFzPOFB1.mjs} +4 -4
  28. package/dist/{ProfileScreen-DCFj7ETG.mjs.map → ProfileScreen-BFzPOFB1.mjs.map} +1 -1
  29. package/dist/{ProfileScreen-CNOAZaoe.cjs → ProfileScreen-CqUT2-XX.cjs} +2 -2
  30. package/dist/{ProfileScreen-CzARNtFJ.cjs → ProfileScreen-T9Exf2DR.cjs} +4 -4
  31. package/dist/{ProfileScreen-CzARNtFJ.cjs.map → ProfileScreen-T9Exf2DR.cjs.map} +1 -1
  32. package/dist/{ShareablesScreen-w3DGRfIr.mjs → ShareablesScreen-Ce-wWJPW.mjs} +4 -4
  33. package/dist/{ShareablesScreen-w3DGRfIr.mjs.map → ShareablesScreen-Ce-wWJPW.mjs.map} +1 -1
  34. package/dist/{ShareablesScreen-Dofp37E4.mjs → ShareablesScreen-CjjnN7JR.mjs} +3 -3
  35. package/dist/{ShareablesScreen-cpwboVjB.cjs → ShareablesScreen-CoAe2YQx.cjs} +3 -3
  36. package/dist/{ShareablesScreen-DSJ7x0Ww.cjs → ShareablesScreen-TqfgVJm_.cjs} +4 -4
  37. package/dist/{ShareablesScreen-DSJ7x0Ww.cjs.map → ShareablesScreen-TqfgVJm_.cjs.map} +1 -1
  38. package/dist/{ShopScreen-vbGhD5GJ.cjs → ShopScreen-7G98Kb3F.cjs} +2 -2
  39. package/dist/{ShopScreen-ByjnSNho.cjs → ShopScreen-Cyq4ebDX.cjs} +4 -4
  40. package/dist/{ShopScreen-ByjnSNho.cjs.map → ShopScreen-Cyq4ebDX.cjs.map} +1 -1
  41. package/dist/{ShopScreen-BlyzHYeU.mjs → ShopScreen-DP4SvMCy.mjs} +4 -4
  42. package/dist/{ShopScreen-BlyzHYeU.mjs.map → ShopScreen-DP4SvMCy.mjs.map} +1 -1
  43. package/dist/{SubscriptionsScreen-BNjDelpe.cjs → SubscriptionsScreen-DMySArYf.cjs} +3 -3
  44. package/dist/{SubscriptionsScreen-DawiAb7q.cjs → SubscriptionsScreen-DvcrZaiR.cjs} +5 -5
  45. package/dist/SubscriptionsScreen-DvcrZaiR.cjs.map +1 -0
  46. package/dist/{SubscriptionsScreen-tUrUZ3VC.mjs → SubscriptionsScreen-PX_Ygilp.mjs} +5 -5
  47. package/dist/SubscriptionsScreen-PX_Ygilp.mjs.map +1 -0
  48. package/dist/index.cjs +30 -30
  49. package/dist/index.d.mts +1 -2
  50. package/dist/index.d.mts.map +1 -1
  51. package/dist/index.mjs +30 -30
  52. package/dist/{products-CBjo08FD.mjs → products--saBmlZw.mjs} +2 -2
  53. package/dist/{products-CBjo08FD.mjs.map → products--saBmlZw.mjs.map} +1 -1
  54. package/dist/{products-Q7fqnjYK.cjs → products-B-qICtJG.cjs} +2 -2
  55. package/dist/{products-Q7fqnjYK.cjs.map → products-B-qICtJG.cjs.map} +1 -1
  56. package/dist/{src-CsjWsZwA.cjs → src-BKkLa2oq.cjs} +4 -4
  57. package/dist/{src-CsjWsZwA.cjs.map → src-BKkLa2oq.cjs.map} +1 -1
  58. package/dist/{src-rgyT4GpO.mjs → src-CECPMmmx.mjs} +4 -4
  59. package/dist/{src-rgyT4GpO.mjs.map → src-CECPMmmx.mjs.map} +1 -1
  60. package/dist/{src-C2NjWMLg.mjs → src-CHFa-f0Q.mjs} +354 -342
  61. package/dist/src-CHFa-f0Q.mjs.map +1 -0
  62. package/dist/{src-B7JarYAL.cjs → src-DvDLW4sK.cjs} +353 -341
  63. package/dist/src-DvDLW4sK.cjs.map +1 -0
  64. package/dist/{use-account-clients-DAQe3cFz.mjs → use-account-clients-7RWjXPNu.mjs} +2 -2
  65. package/dist/{use-account-clients-DAQe3cFz.mjs.map → use-account-clients-7RWjXPNu.mjs.map} +1 -1
  66. package/dist/{use-account-clients-T32HqoLD.cjs → use-account-clients-YWHavlX7.cjs} +2 -2
  67. package/dist/{use-account-clients-T32HqoLD.cjs.map → use-account-clients-YWHavlX7.cjs.map} +1 -1
  68. package/dist/{use-customer-account-C1oG0PQ5.cjs → use-customer-account-BO2vTl2o.cjs} +2 -2
  69. package/dist/{use-customer-account-C1oG0PQ5.cjs.map → use-customer-account-BO2vTl2o.cjs.map} +1 -1
  70. package/dist/{use-customer-account-BV3IWOWw.mjs → use-customer-account-hnWIJ0oS.mjs} +2 -2
  71. package/dist/{use-customer-account-BV3IWOWw.mjs.map → use-customer-account-hnWIJ0oS.mjs.map} +1 -1
  72. package/dist/{use-fluid-api-CQIVrQCO.mjs → use-fluid-api-D8iCEtbP.mjs} +2 -2
  73. package/dist/{use-fluid-api-CQIVrQCO.mjs.map → use-fluid-api-D8iCEtbP.mjs.map} +1 -1
  74. package/dist/{use-fluid-api-B27mJ8gv.cjs → use-fluid-api-haPhtgOR.cjs} +2 -2
  75. package/dist/{use-fluid-api-B27mJ8gv.cjs.map → use-fluid-api-haPhtgOR.cjs.map} +1 -1
  76. package/package.json +10 -10
  77. package/dist/FluidProvider-CWC6LA9W.mjs.map +0 -1
  78. package/dist/SubscriptionsScreen-DawiAb7q.cjs.map +0 -1
  79. package/dist/SubscriptionsScreen-tUrUZ3VC.mjs.map +0 -1
  80. package/dist/src-B7JarYAL.cjs.map +0 -1
  81. package/dist/src-C2NjWMLg.mjs.map +0 -1
@@ -517,53 +517,6 @@ function OrdersList({ customerId, onOrderClick, onSubscriptionClick, t, pageSize
517
517
  });
518
518
  }
519
519
  //#endregion
520
- //#region ../../orders/ui/src/components/section.tsx
521
- function Section({ title, children, footer }) {
522
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Card, { children: [
523
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardHeader, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardTitle, { children: title }) }),
524
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardContent, { children }),
525
- footer && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
526
- className: "px-6 pb-6",
527
- children: footer
528
- })
529
- ] });
530
- }
531
- //#endregion
532
- //#region ../../orders/ui/src/components/shipping-address-card.tsx
533
- function ShippingAddressCard({ name, address, title = "Shipping Address", className }) {
534
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Card, {
535
- className,
536
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardHeader, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardTitle, { children: title }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardContent, { children: !address ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
537
- className: "text-muted-foreground text-sm",
538
- children: "No shipping address available"
539
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
540
- className: "flex items-start gap-2",
541
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Truck, { className: "text-muted-foreground mt-0.5 mr-2 h-4 w-4 shrink-0" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
542
- className: "flex min-w-0 flex-1 flex-col",
543
- children: [
544
- name && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
545
- className: "text-foreground min-w-0 truncate text-sm",
546
- title: name,
547
- children: name
548
- }),
549
- address.line1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
550
- className: "text-muted-foreground text-sm",
551
- children: address.line1
552
- }),
553
- address.line2 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
554
- className: "text-muted-foreground text-sm",
555
- children: address.line2
556
- }),
557
- address.line3 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
558
- className: "text-muted-foreground text-sm",
559
- children: address.line3
560
- })
561
- ]
562
- })]
563
- }) })]
564
- });
565
- }
566
- //#endregion
567
520
  //#region ../../orders/ui/src/lib/format.ts
568
521
  function startCase(str) {
569
522
  if (!str) return "";
@@ -573,71 +526,6 @@ function formatCurrency(symbol, value) {
573
526
  return `${symbol}${Number(value).toFixed(2)}`;
574
527
  }
575
528
  //#endregion
576
- //#region ../../orders/ui/src/components/payment-method-card.tsx
577
- function capitalizeFirstLetter(str) {
578
- if (!str || str.length === 0) return "";
579
- return str.charAt(0).toUpperCase() + str.slice(1);
580
- }
581
- function PaymentDetails({ card }) {
582
- const paymentTitle = card.payment_title || (card.source ? startCase(card.source) : null);
583
- if (card.source === "card" || card.card_type) {
584
- const cardType = capitalizeFirstLetter(card.card_type || "Card");
585
- const lastFour = card.last_four_digits || "XXXX";
586
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
587
- className: "flex w-full flex-row justify-between",
588
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
589
- className: "flex flex-row items-center gap-2.5",
590
- children: [card.logo_url ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
591
- src: card.logo_url,
592
- alt: `${cardType} Logo`,
593
- className: "h-6 w-9 object-contain",
594
- width: 35,
595
- height: 24
596
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
597
- className: "bg-muted text-muted-foreground flex h-6 w-9 items-center justify-center rounded text-xs",
598
- children: cardType.charAt(0)
599
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
600
- className: "text-sm font-medium",
601
- children: [
602
- cardType,
603
- " * ",
604
- lastFour
605
- ]
606
- })]
607
- })
608
- });
609
- }
610
- const displayTitle = paymentTitle || "Payment Method";
611
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
612
- className: "flex w-full flex-row justify-between",
613
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
614
- className: "flex flex-row items-center gap-2.5",
615
- children: [card.logo_url ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
616
- src: card.logo_url,
617
- alt: `${displayTitle} Logo`,
618
- className: "h-6 w-9 object-contain",
619
- width: 35,
620
- height: 24
621
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
622
- className: "flex h-6 w-9 items-center justify-center rounded bg-blue-100 text-xs font-medium text-blue-600 dark:bg-blue-900/30 dark:text-blue-400",
623
- children: displayTitle.charAt(0)
624
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
625
- className: "text-sm font-medium",
626
- children: displayTitle
627
- })]
628
- })
629
- });
630
- }
631
- function PaymentMethodCard({ paymentMethod, title = "Payment Method", className }) {
632
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Card, {
633
- className,
634
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardHeader, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardTitle, { children: title }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CardContent, { children: paymentMethod ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaymentDetails, { card: paymentMethod }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
635
- className: "text-muted-foreground text-sm",
636
- children: "No payment method"
637
- }) })]
638
- });
639
- }
640
- //#endregion
641
529
  //#region ../../orders/ui/src/components/order-status-badge.tsx
642
530
  const statusColorMap = {
643
531
  paid: "green",
@@ -664,231 +552,391 @@ function OrderStatusBadge({ status, className }) {
664
552
  }
665
553
  //#endregion
666
554
  //#region ../../orders/ui/src/components/order-detail.tsx
667
- function formatAddress(address) {
668
- return {
669
- line1: address.address1 ?? "",
670
- line2: [[address.city, address.state].filter(Boolean).join(", "), address.postal_code].filter(Boolean).join(" "),
671
- line3: address.country_code ?? ""
672
- };
673
- }
674
555
  function OrderDetailSkeleton() {
675
556
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
676
- className: "space-y-6",
677
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-16 w-full rounded-lg" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
678
- className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
679
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
680
- className: "space-y-6 lg:col-span-2",
681
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-64 w-full rounded-lg" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-48 w-full rounded-lg" })]
682
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
683
- className: "space-y-6",
557
+ className: "flex flex-col lg:grid lg:grid-cols-8",
558
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
559
+ className: "bg-muted flex flex-col items-center px-8 lg:col-span-4",
560
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
561
+ className: "w-full max-w-lg py-6",
684
562
  children: [
685
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-32 w-full rounded-lg" }),
686
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-32 w-full rounded-lg" }),
687
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-32 w-full rounded-lg" })
563
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "mb-4 h-6 w-48" }),
564
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
565
+ className: "space-y-4",
566
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
567
+ className: "flex items-center space-x-4",
568
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-24 w-24 rounded" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
569
+ className: "flex-1 space-y-2",
570
+ children: [
571
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-4 w-3/4" }),
572
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-4 w-1/2" }),
573
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-4 w-1/4" })
574
+ ]
575
+ })]
576
+ })
577
+ }),
578
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
579
+ className: "mt-6 space-y-2",
580
+ children: [
581
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-4 w-full" }),
582
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-4 w-full" }),
583
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-4 w-full" }),
584
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-5 w-full" })
585
+ ]
586
+ })
688
587
  ]
689
- })]
690
- })]
691
- });
692
- }
693
- function OrderItemRow({ item }) {
694
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
695
- className: "flex items-start gap-4 py-4 first:pt-0 last:pb-0",
696
- children: [
697
- item.image_url && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
698
- src: item.image_url,
699
- alt: item.title,
700
- className: "h-16 w-16 flex-shrink-0 rounded-lg object-cover"
701
- }),
702
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
703
- className: "min-w-0 flex-1",
588
+ })
589
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
590
+ className: "bg-background px-8 pt-4 lg:col-span-4",
591
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
592
+ className: "mx-auto max-w-lg lg:mx-0 lg:mr-auto",
704
593
  children: [
705
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
706
- className: "text-foreground font-medium",
707
- children: item.title
594
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "mb-4 h-10 w-full rounded" }),
595
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
596
+ className: "mt-6 space-y-4",
597
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-5 w-40" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-16 w-full rounded" })]
708
598
  }),
709
- item.ordered_variant.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
710
- className: "text-muted-foreground text-sm",
711
- children: item.ordered_variant.map((v) => v.value).join(" / ")
599
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
600
+ className: "mt-6 space-y-4",
601
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-5 w-40" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-16 w-full rounded" })]
712
602
  }),
713
- item.sku && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
714
- className: "text-muted-foreground text-xs",
715
- children: ["SKU: ", item.sku]
716
- }),
717
- item.subscription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusBadge, {
718
- color: "blue",
719
- size: "xs",
720
- className: "mt-1",
721
- children: "Subscription"
603
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
604
+ className: "mt-6 space-y-4",
605
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-5 w-40" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Skeleton, { className: "h-16 w-full rounded" })]
722
606
  })
723
607
  ]
724
- }),
725
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
726
- className: "text-right text-sm",
727
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
728
- className: "text-foreground font-medium",
608
+ })
609
+ })]
610
+ });
611
+ }
612
+ function OrderItemRow({ item }) {
613
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
614
+ className: "flex items-center space-x-4 py-4",
615
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
616
+ className: "relative shrink-0",
617
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
618
+ className: "bg-muted h-24 w-24 overflow-hidden rounded",
619
+ children: item.image_url ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
620
+ src: item.image_url,
621
+ alt: item.title,
622
+ width: 96,
623
+ height: 96,
624
+ className: "h-full w-full object-cover"
625
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
626
+ className: "text-muted-foreground flex h-full w-full items-center justify-center",
627
+ children: "No image"
628
+ })
629
+ }), item.quantity > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
630
+ className: "bg-foreground text-background absolute -top-2 -right-2 z-10 flex h-6 w-6 items-center justify-center rounded-full text-xs font-medium",
631
+ children: item.quantity
632
+ })]
633
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
634
+ className: "flex min-w-0 flex-1 flex-col space-y-0.5",
635
+ children: [
636
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
637
+ className: "text-foreground truncate text-sm font-medium",
638
+ title: item.title,
639
+ children: item.title
640
+ }),
641
+ item.ordered_variant.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
642
+ className: "text-muted-foreground text-sm",
643
+ children: item.ordered_variant.map((v) => v.value).join(" / ")
644
+ }),
645
+ item.sku && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
646
+ className: "text-muted-foreground text-xs",
647
+ children: ["SKU: ", item.sku]
648
+ }),
649
+ item.subscription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusBadge, {
650
+ color: "blue",
651
+ size: "xs",
652
+ className: "mt-1",
653
+ children: "Subscription"
654
+ }),
655
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
656
+ className: "text-foreground text-sm font-medium",
729
657
  children: item.display_total
730
- }), item.quantity > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
731
- className: "text-muted-foreground",
658
+ }),
659
+ item.quantity > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
660
+ className: "text-muted-foreground text-xs",
732
661
  children: [
733
662
  item.display_price,
734
663
  " x ",
735
664
  item.quantity
736
665
  ]
737
- })]
738
- })
739
- ]
666
+ })
667
+ ]
668
+ })]
740
669
  });
741
670
  }
742
- function OrderPriceSummary({ order }) {
671
+ function OrderItemsSection({ order }) {
672
+ const visibleItems = order.items.filter((item) => item.display_to_customer !== false);
743
673
  const sym = order.currency_symbol || "$";
744
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Section, {
745
- title: "Summary",
746
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
747
- className: "space-y-2 text-sm",
674
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
675
+ className: "bg-muted flex w-full flex-col items-center px-8 lg:col-span-4",
676
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
677
+ className: "flex w-full max-w-lg flex-col",
748
678
  children: [
749
679
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
750
- className: "flex justify-between",
751
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
752
- className: "text-muted-foreground",
753
- children: "Subtotal"
754
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
755
- className: "text-foreground font-medium",
756
- children: order.sub_total_in_currency
757
- })]
680
+ className: "mt-4",
681
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h2", {
682
+ className: "text-foreground mb-2 text-lg font-medium",
683
+ children: [
684
+ "Items (",
685
+ visibleItems.length,
686
+ ")"
687
+ ]
688
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: "border-border" })]
758
689
  }),
759
- Number(order.discount) > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
760
- className: "flex justify-between",
761
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dt", {
762
- className: "text-muted-foreground",
763
- children: ["Discount", order.discount_codes?.length ? ` (${order.discount_codes.join(", ")})` : ""]
764
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
765
- className: "text-foreground font-medium",
766
- children: ["-", order.discount_in_currency]
767
- })]
690
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
691
+ className: "divide-border divide-y",
692
+ children: visibleItems.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderItemRow, { item }, item.id))
768
693
  }),
769
694
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
770
- className: "flex justify-between",
771
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
772
- className: "text-muted-foreground",
773
- children: "Shipping"
774
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
775
- className: "text-foreground font-medium",
776
- children: order.free_shipping ? "Free" : order.shipping_total_for_display
777
- })]
695
+ className: "border-border mb-4 border-t pt-4",
696
+ children: [
697
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
698
+ className: "flex justify-between text-sm",
699
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
700
+ className: "text-muted-foreground font-medium",
701
+ children: "Subtotal"
702
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
703
+ className: "text-muted-foreground font-medium",
704
+ children: order.sub_total_in_currency
705
+ })]
706
+ }),
707
+ Number(order.discount) > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
708
+ className: "mt-2 flex justify-between text-sm",
709
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
710
+ className: "text-muted-foreground font-medium",
711
+ children: ["Discount", order.discount_codes?.length ? ` (${order.discount_codes.join(", ")})` : ""]
712
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
713
+ className: "text-muted-foreground font-medium",
714
+ children: ["-", order.discount_in_currency]
715
+ })]
716
+ }),
717
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
718
+ className: "mt-2 flex justify-between text-sm",
719
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
720
+ className: "text-muted-foreground font-medium",
721
+ children: "Shipping"
722
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
723
+ className: "text-muted-foreground font-medium",
724
+ children: order.free_shipping ? "Free" : order.shipping_total_for_display
725
+ })]
726
+ }),
727
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
728
+ className: "mt-2 flex justify-between text-sm",
729
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
730
+ className: "text-muted-foreground font-medium",
731
+ children: ["Tax", order.price_inclusive_of_tax && order.price_inclusive_tax_name ? ` (${order.price_inclusive_tax_name}, included)` : ""]
732
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
733
+ className: "text-muted-foreground font-medium",
734
+ children: order.tax_in_currency
735
+ })]
736
+ }),
737
+ order.points_applied_amount_in_currency != null && order.points_applied_amount_in_currency > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
738
+ className: "mt-2 flex justify-between text-sm",
739
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
740
+ className: "text-muted-foreground font-medium",
741
+ children: "Points Applied"
742
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
743
+ className: "text-muted-foreground font-medium",
744
+ children: `-${formatCurrency(sym, order.points_applied_amount_in_currency)}`
745
+ })]
746
+ }),
747
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
748
+ className: "mt-4 flex items-center justify-between text-base font-medium",
749
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
750
+ className: "text-muted-foreground text-sm font-medium",
751
+ children: "Total"
752
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
753
+ className: "text-foreground text-base font-bold",
754
+ children: order.total_in_currency
755
+ })]
756
+ })
757
+ ]
758
+ })
759
+ ]
760
+ })
761
+ });
762
+ }
763
+ function OrderDetailsSection({ order }) {
764
+ const paymentDetails = order.payment_details;
765
+ const cardDetails = paymentDetails?.details;
766
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
767
+ className: "bg-background px-8 pt-4 lg:col-span-4",
768
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
769
+ className: "mx-auto max-w-lg lg:mx-0 lg:mr-auto",
770
+ children: [
771
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
772
+ className: "border-border mb-6 border-b pb-6",
773
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
774
+ className: "flex flex-wrap items-center gap-3",
775
+ children: [
776
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
777
+ className: "flex items-center gap-2",
778
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
779
+ className: "text-muted-foreground text-sm",
780
+ children: "Payment:"
781
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderStatusBadge, { status: order.payment_status })]
782
+ }),
783
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
784
+ className: "flex items-center gap-2",
785
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
786
+ className: "text-muted-foreground text-sm",
787
+ children: "Fulfillment:"
788
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderStatusBadge, { status: order.fulfillment_status })]
789
+ }),
790
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
791
+ className: "flex items-center gap-2",
792
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
793
+ className: "text-muted-foreground text-sm",
794
+ children: "Delivery:"
795
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderStatusBadge, { status: order.delivery_status })]
796
+ })
797
+ ]
798
+ })
778
799
  }),
779
800
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
780
- className: "flex justify-between",
781
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dt", {
782
- className: "text-muted-foreground",
783
- children: ["Tax", order.price_inclusive_of_tax && order.price_inclusive_tax_name ? ` (${order.price_inclusive_tax_name}, included)` : ""]
784
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
785
- className: "text-foreground font-medium",
786
- children: order.tax_in_currency
801
+ className: "border-border mb-6 border-b pb-6",
802
+ children: [
803
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
804
+ className: "text-foreground mb-3 text-sm/6 font-semibold",
805
+ children: "Order Info"
806
+ }),
807
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
808
+ className: "divide-border flex divide-x",
809
+ children: [
810
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
811
+ className: "flex-1 pr-4",
812
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
813
+ className: "text-muted-foreground text-sm",
814
+ children: "Order Number"
815
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
816
+ className: "text-foreground font-medium",
817
+ children: order.order_number
818
+ })]
819
+ }),
820
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
821
+ className: "flex-1 px-4",
822
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
823
+ className: "text-muted-foreground text-sm",
824
+ children: "Channel"
825
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
826
+ className: "text-foreground font-medium",
827
+ children: startCase(order.channel)
828
+ })]
829
+ }),
830
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
831
+ className: "flex-1 pl-4 text-right",
832
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
833
+ className: "text-muted-foreground text-sm",
834
+ children: "Date"
835
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
836
+ className: "text-foreground font-medium",
837
+ children: new Date(order.created_at).toLocaleDateString("en-US", {
838
+ year: "numeric",
839
+ month: "short",
840
+ day: "numeric"
841
+ })
842
+ })]
843
+ })
844
+ ]
845
+ }),
846
+ order.email && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
847
+ className: "mt-3",
848
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
849
+ className: "text-muted-foreground text-sm",
850
+ children: "Email"
851
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
852
+ className: "text-foreground text-sm font-medium",
853
+ children: order.email
854
+ })]
855
+ })
856
+ ]
857
+ }),
858
+ paymentDetails && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
859
+ className: "border-border mb-6 border-b pb-4",
860
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
861
+ className: "text-muted-foreground mb-1 text-sm",
862
+ children: "Payment Method"
863
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
864
+ className: "text-foreground flex items-center gap-2 text-sm",
865
+ children: [cardDetails?.logo_url ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
866
+ src: cardDetails.logo_url,
867
+ alt: cardDetails.card_type ?? "Card",
868
+ className: "h-6 w-9 object-contain",
869
+ width: 35,
870
+ height: 24
871
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
872
+ className: "bg-muted text-muted-foreground flex h-6 w-9 items-center justify-center rounded text-xs",
873
+ children: (paymentDetails.payment_title || paymentDetails.payment_type || "P").charAt(0)
874
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
875
+ className: "font-medium",
876
+ children: [cardDetails?.card_type ? startCase(cardDetails.card_type) : paymentDetails.payment_title || startCase(paymentDetails.payment_type), cardDetails?.last_four ? ` ending in ${cardDetails.last_four}` : ""]
877
+ })]
787
878
  })]
788
879
  }),
789
- order.points_applied_amount_in_currency != null && order.points_applied_amount_in_currency > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
790
- className: "flex justify-between",
791
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
792
- className: "text-muted-foreground",
793
- children: "Points Applied"
794
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
795
- className: "text-foreground font-medium",
796
- children: ["-", formatCurrency(sym, order.points_applied_amount_in_currency)]
880
+ order.ship_to && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
881
+ className: "border-border mb-6 border-b pb-4",
882
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
883
+ className: "text-muted-foreground mb-1 text-sm",
884
+ children: "Shipping Address"
885
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
886
+ className: "text-foreground flex items-start gap-2 text-sm",
887
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Truck, { className: "text-muted-foreground mt-0.5 mr-1 h-4 w-4 shrink-0" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
888
+ className: "flex flex-col",
889
+ children: [
890
+ order.ship_to.name && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
891
+ className: "font-medium",
892
+ children: order.ship_to.name
893
+ }),
894
+ order.ship_to.address1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: order.ship_to.address1 }),
895
+ (order.ship_to.city || order.ship_to.state || order.ship_to.postal_code) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: [[order.ship_to.city, order.ship_to.state].filter(Boolean).join(", "), order.ship_to.postal_code].filter(Boolean).join(" ") }),
896
+ order.ship_to.country_code && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: order.ship_to.country_code })
897
+ ]
898
+ })]
797
899
  })]
798
900
  }),
799
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
800
- className: "border-border flex justify-between border-t pt-2",
801
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
802
- className: "text-foreground font-semibold",
803
- children: "Total"
804
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
805
- className: "text-foreground font-semibold",
806
- children: order.total_in_currency
901
+ order.bill_to && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
902
+ className: "border-border mb-6 border-b pb-4",
903
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
904
+ className: "text-muted-foreground mb-1 text-sm",
905
+ children: "Billing Address"
906
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
907
+ className: "text-foreground text-sm",
908
+ children: [
909
+ order.bill_to.name && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
910
+ className: "font-medium",
911
+ children: order.bill_to.name
912
+ }),
913
+ order.bill_to.address1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: order.bill_to.address1 }),
914
+ (order.bill_to.city || order.bill_to.state || order.bill_to.postal_code) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: [[order.bill_to.city, order.bill_to.state].filter(Boolean).join(", "), order.bill_to.postal_code].filter(Boolean).join(" ") }),
915
+ order.bill_to.country_code && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: order.bill_to.country_code })
916
+ ]
807
917
  })]
918
+ }),
919
+ order.shipping_method && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
920
+ className: "border-border mb-6 border-b pb-4",
921
+ children: [
922
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
923
+ className: "text-muted-foreground mb-1 text-sm",
924
+ children: "Shipping Method"
925
+ }),
926
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
927
+ className: "text-foreground text-sm font-medium",
928
+ children: order.shipping_method.title
929
+ }),
930
+ order.shipping_method.delivery_time_estimate && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
931
+ className: "text-muted-foreground mt-1 text-xs",
932
+ children: ["Est. ", order.shipping_method.delivery_time_estimate]
933
+ })
934
+ ]
808
935
  })
809
936
  ]
810
937
  })
811
938
  });
812
939
  }
813
- function OrderStatusRow({ order }) {
814
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
815
- className: "border-border bg-card flex flex-wrap items-center gap-3 rounded-lg border p-6",
816
- children: [
817
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
818
- className: "flex items-center gap-2",
819
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
820
- className: "text-muted-foreground text-sm",
821
- children: "Payment:"
822
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderStatusBadge, { status: order.payment_status })]
823
- }),
824
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
825
- className: "flex items-center gap-2",
826
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
827
- className: "text-muted-foreground text-sm",
828
- children: "Fulfillment:"
829
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderStatusBadge, { status: order.fulfillment_status })]
830
- }),
831
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
832
- className: "flex items-center gap-2",
833
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
834
- className: "text-muted-foreground text-sm",
835
- children: "Delivery:"
836
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderStatusBadge, { status: order.delivery_status })]
837
- }),
838
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
839
- className: "text-muted-foreground ml-auto text-sm",
840
- children: new Date(order.created_at).toLocaleDateString("en-US", {
841
- year: "numeric",
842
- month: "long",
843
- day: "numeric"
844
- })
845
- })
846
- ]
847
- });
848
- }
849
- function OrderInfoCard({ order }) {
850
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Section, {
851
- title: "Order Info",
852
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
853
- className: "space-y-2 text-sm",
854
- children: [
855
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
856
- className: "text-muted-foreground",
857
- children: "Order Number"
858
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
859
- className: "text-foreground font-medium",
860
- children: order.order_number
861
- })] }),
862
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
863
- className: "text-muted-foreground",
864
- children: "Channel"
865
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
866
- className: "text-foreground font-medium",
867
- children: startCase(order.channel)
868
- })] }),
869
- order.email && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
870
- className: "text-muted-foreground",
871
- children: "Email"
872
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
873
- className: "text-foreground font-medium",
874
- children: order.email
875
- })] })
876
- ]
877
- })
878
- });
879
- }
880
- function ShippingMethodCard({ method }) {
881
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
882
- title: "Shipping Method",
883
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
884
- className: "text-muted-foreground text-sm",
885
- children: method.title
886
- }), method.delivery_time_estimate && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
887
- className: "text-muted-foreground mt-1 text-xs",
888
- children: ["Est. ", method.delivery_time_estimate]
889
- })]
890
- });
891
- }
892
940
  function OrderDetail({ token, onNotFound, onError }) {
893
941
  const { data, isLoading, error } = useOrder(token);
894
942
  const order = data?.order;
@@ -909,45 +957,9 @@ function OrderDetail({ token, onNotFound, onError }) {
909
957
  ]);
910
958
  if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderDetailSkeleton, {});
911
959
  if (!order) return null;
912
- const visibleItems = order.items.filter((item) => item.display_to_customer !== false);
913
960
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
914
- className: "space-y-6",
915
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderStatusRow, { order }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
916
- className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
917
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
918
- className: "space-y-6 lg:col-span-2",
919
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Section, {
920
- title: `Items (${order.items_count})`,
921
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
922
- className: "divide-border divide-y",
923
- children: visibleItems.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderItemRow, { item }, item.id))
924
- })
925
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderPriceSummary, { order })]
926
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
927
- className: "space-y-6",
928
- children: [
929
- order.payment_details && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaymentMethodCard, { paymentMethod: {
930
- source: order.payment_details.payment_type,
931
- payment_title: order.payment_details.payment_title,
932
- logo_url: order.payment_details.details.logo_url,
933
- card_type: order.payment_details.details.card_type,
934
- last_four_digits: order.payment_details.details.last_four
935
- } }),
936
- order.ship_to && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShippingAddressCard, {
937
- name: order.ship_to.name,
938
- address: formatAddress(order.ship_to),
939
- title: "Shipping Address"
940
- }),
941
- order.bill_to && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShippingAddressCard, {
942
- name: order.bill_to.name,
943
- address: formatAddress(order.bill_to),
944
- title: "Billing Address"
945
- }),
946
- order.shipping_method && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShippingMethodCard, { method: order.shipping_method }),
947
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderInfoCard, { order })
948
- ]
949
- })]
950
- })]
961
+ className: "flex flex-col lg:grid lg:grid-cols-8",
962
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderItemsSection, { order }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrderDetailsSection, { order })]
951
963
  });
952
964
  }
953
965
  //#endregion
@@ -982,4 +994,4 @@ Object.defineProperty(exports, "TableColumn", {
982
994
  }
983
995
  });
984
996
 
985
- //# sourceMappingURL=src-B7JarYAL.cjs.map
997
+ //# sourceMappingURL=src-DvDLW4sK.cjs.map