"use client"; import type { ReactNode } from "react"; import { Check } from "lucide-react"; import { Dialog, DialogContent, DialogDescription, DialogTitle } from "@/app/components/ui/dialog"; import { Button } from "@/app/components/ui/button"; import { useMoney } from "@/app/pos/currency"; import { useT } from "@/app/lib/i18n/MessagesProvider"; // After a POS sale (redesign-pos-sale-flow, BABYBOO-38): "Payment complete", the receipt (children, built // by the page), how the buyer gets the goods, and Start new sale — the only way out, so the operator // never loses the receipt by a stray tap. interface ReceiptDialogProps { open: boolean; documentNo: string; total: number; /** "Taken in store", "Pick up at …" or "Delivery to …". */ collection: string; onNewSale: () => void; children: ReactNode; } export function ReceiptDialog({ open, documentNo, total, collection, onNewSale, children }: ReceiptDialogProps) { const money = useMoney(); const t = useT(); const [collectionPre, collectionPost] = t("PosCollectionLabel").split("{collection}"); return ( e.preventDefault()} onInteractOutside={(e) => e.preventDefault()} className="max-h-[calc(100svh-2rem)] overflow-y-auto sm:max-w-3xl [&>*]:min-w-0" >
{t("PosPaymentComplete")} {t("PosSaleSummary", { documentNo, total: money(total) })}

{collectionPre} {collection} {collectionPost}

{children}
); }