diff --git a/components/admin/DetailModal.tsx b/components/admin/DetailModal.tsx index b045367..0ae2d66 100644 --- a/components/admin/DetailModal.tsx +++ b/components/admin/DetailModal.tsx @@ -443,6 +443,50 @@ export default function DetailModal({ open, onOpenChange, title, data, fields, k {/* ── Formatted Tab ── */}
+ {/* Subscriptions & cost-breakdown — renders above field groups (UI-SPEC: focal point) */} + {Array.isArray(data.subscriptions) && ( +
+

Subscriptions & Cost

+
+ {data.subscriptions.length === 0 ? ( +
No subscriptions
+ ) : ( + <> +
+
Product
+
Qty
+
Billing Term
+
Amount
+
+ {data.subscriptions.map((sub: any, idx: number) => { + const productLabel = sub.productName || sub.sku || 'Unknown item'; + const amount = Number(sub.latestBilledAmount ?? 0); + const currency = sub.currency ?? 'USD'; + return ( +
+ {idx > 0 && } +
+
{productLabel}
+
{sub.quantity ?? '—'}
+
{sub.billingTerm ?? '—'}
+
{currency} {amount.toFixed(2)}
+
+
+ ); + })} + +
+
Total
+
+ {(data.subscriptions[0]?.currency ?? 'USD')} {data.subscriptions.reduce((s: number, sub: any) => s + Number(sub.latestBilledAmount ?? 0), 0).toFixed(2)} +
+
+ + )} +
+
+ )} + {(() => { const rendered = new Set(); return groups.map((group) => {