@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
18 lines (17 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importStar(require("react"));
var hooks_1 = require("../app/hooks");
var slices_1 = require("../slices");
var InputButton_1 = tslib_1.__importDefault(require("./InputButton"));
var CheckoutTable = function (_a) {
var label = _a.label, labelStyle = _a.labelStyle, openTable = _a.openTable, InputButtonView = _a.InputButtonView, children = _a.children;
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).checkoutTable;
var table = (0, hooks_1.useAppSelector)(slices_1.selectOrder).table;
var renderTableInput = (0, react_1.useCallback)(function () {
return (react_1.default.createElement(InputButton_1.default, { label: label, labelStyle: labelStyle, value: table || '', open: openTable, isRequired: false, children: InputButtonView }));
}, [InputButtonView, label, labelStyle, openTable, table]);
return children({ config: config, renderTableInput: renderTableInput });
};
exports.default = CheckoutTable;