deckhearth/components/scanner/ScannerCountPill.js
varutasu 73424aae59
Mobile scanner checkout: scan first, commit later (#157)
* Start scanner-mobile-checkout convoy for the cart-then-commit phone flow.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Ship a cart-then-commit mobile scanner so phone sessions stay on the camera.

Scan matches enqueue locally instead of auto-writing ownership, checkout happens in a sheet, and audit fixes cover stale commit detection, returnUrl open redirects, nested Escape, and ember detection chrome.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 20:20:43 -05:00

25 lines
809 B
JavaScript

export default function ScannerCountPill({ count, onReview, onOpenCheckout }) {
const handleClick = onOpenCheckout || onReview;
if (count <= 0) return null;
return (
<button
type="button"
onClick={handleClick}
className="rounded-full px-4 py-2 text-sm font-semibold transition-transform active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2"
style={{
background: 'var(--gradient-primary)',
color: 'var(--text-primary-dark)',
boxShadow: 'var(--ember-rim-pronounced)',
minHeight: 44,
minWidth: 44,
'--tw-ring-color': 'var(--accent-ember)',
'--tw-ring-offset-color': 'transparent',
}}
aria-label={`Review ${count} scanned cards`}
>
Review {count}
</button>
);
}