'use client'; import { CreditCardIcon } from '@heroicons/react/24/outline'; import { formatCurrency } from '@/lib/utils'; import type { DoorCharge } from './PaymentButtons'; // The POS step of the door screen. // // Unlike cash, the money is not in staff's hand when they pick POS: they first // key the amount into the physical card terminal, wait for approval, and only // then confirm here. So POS is two taps: pick POS (this panel opens with the // amount to type), then "Mark as paid", which records it through the same // door-checkin call as every other tender. // // Nothing talks to the terminal today. If an automatic amount push is added // later, it starts when this panel opens and its approval replaces (or pre-fills) // the manual confirmation below; the rest of the door flow stays unchanged. export function PosChargePanel({ charge, unitPrice, currency, disabled, onConfirm, onBack, }: { charge: DoorCharge; unitPrice: number; currency: string; disabled?: boolean; onConfirm: () => void; onBack: () => void; }) { return (

POS — charge on the terminal

Amount to charge

{formatCurrency(charge.amount, currency)}

{charge.override ? (

Custom amount

) : charge.quantity > 1 ? (

{charge.quantity} × {formatCurrency(unitPrice, currency)}

) : null}

Only tap once the terminal has approved the card.

); }