order-details: null item amounts render nothing, not $0.00; qty defaults to 1
ci / lint-test (push) Successful in 1m4s
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:
@@ -99,7 +99,7 @@ export function OrderDetails({
|
|||||||
<ul className="space-y-1.5 mb-3">
|
<ul className="space-y-1.5 mb-3">
|
||||||
{items.map((it, i) => (
|
{items.map((it, i) => (
|
||||||
<li key={i} className="flex gap-2 text-xs items-start">
|
<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">
|
<span className="text-zinc-300 flex-1 min-w-0">
|
||||||
{it.description}
|
{it.description}
|
||||||
{it.options && it.options.length > 0 && (
|
{it.options && it.options.length > 0 && (
|
||||||
@@ -114,7 +114,12 @@ export function OrderDetails({
|
|||||||
rating={mine?.rating ?? null}
|
rating={mine?.rating ?? null}
|
||||||
note={mine?.note ?? null}
|
note={mine?.note ?? null}
|
||||||
/>
|
/>
|
||||||
|
{/* 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>
|
<span className="text-zinc-400 tabular-nums shrink-0">{fmt(Number(it.amount))}</span>
|
||||||
|
)}
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user