@open-tender/store
Version:
A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API
22 lines (21 loc) • 1.15 kB
JavaScript
import { useAppSelector } from '../app/hooks';
import { selectKioskConfig } from '../slices';
var Quantity = function (_a) {
var quantity = _a.quantity, increment = _a.increment, _b = _a.incrementDisabled, incrementDisabled = _b === void 0 ? false : _b, decrement = _a.decrement, _c = _a.decrementDisabled, decrementDisabled = _c === void 0 ? false : _c, _d = _a.fontSize, fontSize = _d === void 0 ? 28 : _d, _e = _a.iconSize, iconSize = _e === void 0 ? 36 : _e, _f = _a.strokeWidth, strokeWidth = _f === void 0 ? 2 : _f, _g = _a.className, className = _g === void 0 ? 'quantity' : _g, children = _a.children;
var _h = useAppSelector(selectKioskConfig), _j = className, config = _h[_j];
var handlers = { increment: increment, decrement: decrement };
if (!config)
return null;
return children({
config: config,
handlers: handlers,
quantity: quantity,
incrementDisabled: incrementDisabled,
decrementDisabled: decrementDisabled,
fontSize: fontSize,
iconSize: iconSize,
strokeWidth: strokeWidth,
className: className
});
};
export default Quantity;