"use client"; import { Product } from "@/lib/types"; interface Props { products: Product[]; quantities: Record; onAdd: (productId: string) => void; } /** One tap adds one unit of a product to the current sale. */ export default function ProductGrid({ products, quantities, onAdd }: Props) { if (products.length === 0) { return (
No products configured yet. Ask the owner to add them.
); } return (
Tap a product to add it
{products.map((p) => { const inCart = quantities[p._id] ?? 0; return ( ); })}
); }