order-details: null item amounts render nothing, not $0.00; qty defaults to 1
ci / lint-test (push) Successful in 1m4s

Spine-bridged receipts (Amazon shipment notices, eBay) name the goods
without per-item prices — null means 'the mail didn't say', and printing
$0.00 would assert it did.
This commit is contained in:
2026-08-10 13:37:39 +10:00
parent a1e776e9be
commit 7819a88af2
+7 -2
View File
@@ -99,7 +99,7 @@ export function OrderDetails({
<ul className="space-y-1.5 mb-3">
{items.map((it, i) => (
<li key={i} className="flex gap-2 text-xs items-start">
<span className="text-zinc-600 tabular-nums shrink-0">{it.qty}×</span>
<span className="text-zinc-600 tabular-nums shrink-0">{it.qty ?? 1}×</span>
<span className="text-zinc-300 flex-1 min-w-0">
{it.description}
{it.options && it.options.length > 0 && (
@@ -114,7 +114,12 @@ export function OrderDetails({
rating={mine?.rating ?? null}
note={mine?.note ?? null}
/>
<span className="text-zinc-400 tabular-nums shrink-0">{fmt(Number(it.amount))}</span>
{/* Spine-bridged receipts (Amazon shipment notices, eBay) often
name the goods without per-item prices — a null here is "the
mail didn't say", and printing $0.00 would assert it did. */}
{it.amount != null && (
<span className="text-zinc-400 tabular-nums shrink-0">{fmt(Number(it.amount))}</span>
)}
</li>
))}
</ul>