| SKU | +Description | +Ord | +Coll | +Cost | +Surplus | +
|---|---|---|---|---|---|
| {row.sku ?? "—"} | +{row.description ?? row.po_description ?? "—"} | +{ordered} | +{collected} | +
+ {isEditing && edit ? (
+
+ updateValue(row.id, value)}
+ onBlur={() => save(row.id)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") save(row.id);
+ if (e.key === "Escape") cancel();
+ }}
+ className="h-8 w-24 px-2 py-1 text-right"
+ aria-label="Edit cost"
+ data-testid={`cost-input-${row.id}`}
+ aria-invalid={edit.error ? true : undefined}
+ />
+ {edit.error ? (
+
+ {edit.error}
+
+ ) : (
+
+ Enter to save, Esc to cancel
+
+ )}
+
+ ) : (
+
+ R{(row.cost_price ?? 0).toFixed(2)}
+
+
+ )}
+ |
+ {surplus > 0 ? `+${surplus}` : "—"} | +